@@ 74-92 (lines=19) @@ | ||
71 | * |
|
72 | * @return EmailContent |
|
73 | */ |
|
74 | public function build(InformationCollected $value): EmailContent |
|
75 | { |
|
76 | $contentType = $value->getContentType(); |
|
77 | ||
78 | $template = $this->resolveTemplate($contentType->identifier); |
|
79 | ||
80 | $templateWrapper = $this->twig->load($template); |
|
81 | $data = new TemplateContent($value, $templateWrapper); |
|
82 | ||
83 | $body = $this->resolveBody($data); |
|
84 | ||
85 | return new EmailContent( |
|
86 | $this->resolveEmail($data, Constants::FIELD_RECIPIENT), |
|
87 | $this->resolveEmail($data, Constants::FIELD_SENDER), |
|
88 | $this->resolve($data, Constants::FIELD_SUBJECT), |
|
89 | $body, |
|
90 | $this->resolveAttachments($contentType->identifier, $value->getInformationCollectionStruct()->getFieldsData()) |
|
91 | ); |
|
92 | } |
|
93 | ||
94 | public function provide(InformationCollected $value): Email |
|
95 | { |
@@ 74-92 (lines=19) @@ | ||
71 | * |
|
72 | * @return EmailContent |
|
73 | */ |
|
74 | public function build(InformationCollected $value): EmailContent |
|
75 | { |
|
76 | $contentType = $value->getContentType(); |
|
77 | ||
78 | $template = $this->resolveTemplate($contentType->identifier); |
|
79 | ||
80 | $templateWrapper = $this->twig->load($template); |
|
81 | $data = new TemplateContent($value, $templateWrapper); |
|
82 | ||
83 | $body = $this->resolveBody($data); |
|
84 | ||
85 | return new EmailContent( |
|
86 | $this->resolveEmail($data, Constants::FIELD_RECIPIENT), |
|
87 | $this->resolveEmail($data, Constants::FIELD_SENDER), |
|
88 | $this->resolve($data, Constants::FIELD_SUBJECT), |
|
89 | $body, |
|
90 | $this->resolveAttachments($contentType->identifier, $value->getInformationCollectionStruct()->getFieldsData()) |
|
91 | ); |
|
92 | } |
|
93 | ||
94 | /** |
|
95 | * Returns resolved parameter. |