parent
ebdcc1d4f5
commit
37f762036b
1
.env
1
.env
@ -22,4 +22,5 @@ APP_SECRET=
|
|||||||
###> symfony/mailer ###
|
###> symfony/mailer ###
|
||||||
MAILER_DSN=smtp://${MAILER_USER:-null}:${MAILER_PASSWORD:-null}@${MAILER_HOST:-localhost}:${MAILER_PORT:-1025}
|
MAILER_DSN=smtp://${MAILER_USER:-null}:${MAILER_PASSWORD:-null}@${MAILER_HOST:-localhost}:${MAILER_PORT:-1025}
|
||||||
CONTACT_MAIL=${CONTACT_MAIL:-contact@localhost}
|
CONTACT_MAIL=${CONTACT_MAIL:-contact@localhost}
|
||||||
|
SENDER_MAIL=${SENDER_MAIL:-noreply@localhost}
|
||||||
###< symfony/mailer ###
|
###< symfony/mailer ###
|
||||||
|
@ -13,6 +13,8 @@ final readonly class ContactService
|
|||||||
private MailerInterface $mailer,
|
private MailerInterface $mailer,
|
||||||
#[Autowire(env: 'CONTACT_MAIL')]
|
#[Autowire(env: 'CONTACT_MAIL')]
|
||||||
private string $contactEmail,
|
private string $contactEmail,
|
||||||
|
#[Autowire(env: 'SENDER_MAIL')]
|
||||||
|
private string $senderEmail,
|
||||||
){
|
){
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -22,7 +24,7 @@ final readonly class ContactService
|
|||||||
->htmlTemplate('email/contact.html.twig')
|
->htmlTemplate('email/contact.html.twig')
|
||||||
->context(['data' => $data])
|
->context(['data' => $data])
|
||||||
->subject('Kontakt aufnahme')
|
->subject('Kontakt aufnahme')
|
||||||
->from($data->email)
|
->from($this->senderEmail)
|
||||||
->to($this->contactEmail);
|
->to($this->contactEmail);
|
||||||
|
|
||||||
$this->mailer->send($mail);
|
$this->mailer->send($mail);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user