src/Entity/Inquiry/Contact.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Inquiry;
  3. use App\Entity\Traits\Inquiry\InquiryTrait;
  4. use App\Repository\Inquiry\ContactRepository;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use App\Entity\Traits\ModifiedTimeTrait;
  7. use App\Entity\Traits\ModifiedLifecycleTrait;
  8. /**
  9.  * @ORM\Entity(repositoryClass=ContactRepository::class)
  10.  * @ORM\HasLifecycleCallbacks()
  11.  * @ORM\Table(name="inquiry_contact")
  12.  */
  13. class Contact implements InquiryInterface
  14. {
  15.     use InquiryTrait;
  16.     use ModifiedTimeTrait;
  17.     use ModifiedLifecycleTrait;
  18.     /**
  19.      * @ORM\Column(type="string", length=12, nullable=true)
  20.      */
  21.     private $subject;
  22.     public function getMailSendConfig(): array {
  23.         return [
  24.             "to_client" => [
  25.                 "twigTextTemplate" => "mail/contact/client.txt.twig",
  26.                 "subject" => "アオイ建設株式会社に、お問い合わせが届いています。",
  27.                 "twigAssign" => [
  28.                     "inquiry" => $this
  29.                 ]
  30. //              send to address. 未指定で global_clientに送る
  31. //              "to" => ["to addresses..."]
  32. //              cc
  33. //              "cc" => ["cc addresses"]
  34. //              bcc
  35. //              "bcc" => ["bcc addresses"]
  36. //              replyTo
  37. //              "replyTo" => "reply address"
  38. //              returnPath
  39. //              "returnPath" => "return path"
  40.             ],
  41.             "reply" => [
  42.                 "twigTextTemplate" => "mail/contact/reply.txt.twig",
  43.                 "subject" => "アオイ建設株式会社にお問い合わせをいただき、ありがとうございます。",
  44.                 "to" => [$this->getEmail()],
  45.                 "twigAssign" => [
  46.                     "inquiry" => $this
  47.                 ]
  48.             ]
  49.         ];
  50.     }
  51.     public function getPardotErrorMailConfig(): ?array
  52.     {
  53.         return [
  54.             "twigTextTemplate" => "mail/contact/pardot_error.txt.twig",
  55.             "subject" => "お問い合わせでPardot送信に失敗しました",
  56.             "twigAssign" => [
  57.                 "inquiry" => $this
  58.             ]
  59.         ];
  60.     }
  61.     public function getSubject(): ?string
  62.     {
  63.         return $this->subject;
  64.     }
  65.     public function setSubject(?string $subject): self
  66.     {
  67.         $this->subject $subject;
  68.         return $this;
  69.     }
  70. }