src/Entity/Abo/AdressMutation.php line 5

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Abo;
  3. class AdressMutation
  4. {
  5. private static $textData = ['order_send_msg' => "Wir haben Ihre Mitteilung erhalten. Vielen Dank.\nWir werden dies entsprechend in unserem System hinterlegen."];
  6. // Formular Felder
  7. public $datumAb;
  8. public $vorname;
  9. public $nachname;
  10. public $firma;
  11. public $strasse;
  12. public $plz;
  13. public $ort;
  14. public $land = 'Schweiz';
  15. public $telefon;
  16. public $email;
  17. public $mitteilung;
  18. public $altVorname;
  19. public $altNachname;
  20. public $altFirma;
  21. public $altStrasse;
  22. public $altPlz;
  23. public $altOrt;
  24. public $altLand = 'Schweiz';
  25. public $altTelefon;
  26. public $altEmail;
  27. // Ende Formular Felder
  28. protected function __construct()
  29. {
  30. }
  31. public static function createMutation(): AdressMutation
  32. {
  33. return new self();
  34. }
  35. public function orderSendMessage(): string
  36. {
  37. return self::$textData['order_send_msg'];
  38. }
  39. /**
  40. * Zusammenfassung Bestellung für Mailbody.
  41. */
  42. public function mailBodyBestellung(): string
  43. {
  44. $body = '<br>
  45. Neue <b>Adressänderung</b> vom '.date('d.m.Y H:i').' ab www.urnerwochenblatt.ch<br>'
  46. ;
  47. if ($this->datumAb) {
  48. $body .= '<br>
  49. <br>
  50. <b>Ab Datum</b><br>'
  51. .$this->datumAb->format('d.m.Y').'<br>'
  52. ;
  53. }
  54. $body .= '<br>
  55. <table>
  56. <tr>
  57. <td colspan="2"><br><b>Bisherige Adresse</b><br></td>
  58. </tr>
  59. <tr>
  60. <td>Vor-/Nachname</td><td>'.$this->vorname.' '.$this->nachname.'</td>
  61. </tr>
  62. <tr>
  63. <td>Firma</td><td>'.$this->firma.'</td>
  64. </tr>
  65. <tr>
  66. <td>Strasse</td><td>'.$this->strasse.'</td>
  67. </tr>
  68. <tr>
  69. <td>PLZ/Ort</td><td>'.$this->plz.' '.$this->ort.'</td>
  70. </tr>
  71. <tr>
  72. <td>Land</td><td>'.$this->land.'</td>
  73. </tr>
  74. <tr>
  75. <td>Telefon</td><td>'.$this->telefon.'</td>
  76. </tr>
  77. <tr>
  78. <td>E-Mail</td><td>'.$this->email.'</td>
  79. </tr>
  80. </table>'
  81. ;
  82. $body .= '<br>
  83. <table>
  84. <tr>
  85. <td colspan="2"><br><b>Neue Adresse</b><br></td>
  86. </tr>
  87. <tr>
  88. <td>Vor-/Nachname</td><td>'.$this->altVorname.' '.$this->altNachname.'</td>
  89. </tr>
  90. <tr>
  91. <td>Firma</td><td>'.$this->altFirma.'</td>
  92. </tr>
  93. <tr>
  94. <td>Strasse</td><td>'.$this->altStrasse.'</td>
  95. </tr>
  96. <tr>
  97. <td>PLZ/Ort</td><td>'.$this->altPlz.' '.$this->altOrt.'</td>
  98. </tr>
  99. <tr>
  100. <td>Land</td><td>'.$this->altLand.'</td>
  101. </tr>
  102. <tr>
  103. <td>Telefon</td><td>'.$this->altTelefon.'</td>
  104. </tr>
  105. <tr>
  106. <td>E-Mail</td><td>'.$this->altEmail.'</td>
  107. </tr>
  108. </table>'
  109. ;
  110. if ($this->mitteilung) {
  111. $body .= '<br><br>
  112. <b>Mitteilung</b><br>'
  113. .str_replace("\n", '<br>', strip_tags((string) $this->mitteilung)).'<br>';
  114. }
  115. return $body;
  116. }
  117. public function mailSubjectBestellung(): string
  118. {
  119. return 'Neue Mitteilung: Adressänderung';
  120. }
  121. }