Skip to content

Commit

Permalink
add no-reply email to tickets
Browse files Browse the repository at this point in the history
  • Loading branch information
rserry committed Oct 21, 2023
1 parent 35779b7 commit 21aa575
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,11 @@
'value' => '[email protected]',
'description' => 'The mail address of system administrator',
),
array(
'key' => 'system_no-reply_mail',
'value' => '[email protected]',
'description' => 'The no-reply mail address',
),
array(
'key' => 'fallback_language',
'value' => 'nl',
Expand Down
7 changes: 6 additions & 1 deletion module/TicketBundle/Controller/TicketController.php
Original file line number Diff line number Diff line change
Expand Up @@ -1004,6 +1004,10 @@ private function sendMail(Ticket $ticket)
->getRepository('CommonBundle\Entity\General\Config')
->getConfigValue('ticket.confirmation_email_from');

$noreplyAddress = $this->getEntityManager()
->getRepository('CpmmonBundle\Entity\General\Config')
->getConfifValue('system_no-reply_mail');

if ($ticket->getPerson()) {
$person = $ticket->getPerson();
$fullName = $person->getFullName();
Expand Down Expand Up @@ -1034,7 +1038,8 @@ private function sendMail(Ticket $ticket)

$mail->setEncoding('UTF-8')
->setBody(str_replace(array('{{ fullname }}', '{{ event }}', '{{ option }}', '{{ paylink }}'), array($fullName, $eventName, $optionString, $payLink), $mailBody))
->setFrom($mailFrom)
->setFrom($noreplyAddress)
->setReplyTo($mailFrom)
->addTo($mailTo)
->addBcc($mailFrom)
->addBcc($this->getEntityManager()
Expand Down
7 changes: 6 additions & 1 deletion module/TicketBundle/Entity/Ticket.php
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,10 @@ public function sendQrMail($controller, $language)
->getRepository('CommonBundle\Entity\General\Config')
->getConfigValue('ticket.subscription_mail_name');

$noreplyAddress = $entityManager
->getRepository('CpmmonBundle\Entity\General\Config')
->getConfifValue('system_no-reply_mail');

$url = $controller->url()
->fromRoute(
'ticket',
Expand Down Expand Up @@ -644,7 +648,8 @@ public function sendQrMail($controller, $language)
$mail = new Message();
$mail->setEncoding('UTF-8')
->setBody($newMessage)
->setFrom($mailAddress, $mailName)
->setFrom($noreplyAddress, $mailName)
->setReplyTo($mailAddress, $mailName)
->addTo($this->getEmail(), $this->getFullName())
->setSubject($subject)
->addBcc($entityManager
Expand Down

0 comments on commit 21aa575

Please sign in to comment.