3 namespace Drupal\contact;
5 use Drupal\Core\Entity\ContentEntityInterface;
8 * Provides an interface defining a contact message entity.
10 interface MessageInterface extends ContentEntityInterface {
13 * Returns the form this contact message belongs to.
15 * @return \Drupal\contact\ContactFormInterface
16 * The contact form entity.
18 public function getContactForm();
21 * Returns the name of the sender.
24 * The name of the message sender.
26 public function getSenderName();
29 * Sets the name of the message sender.
31 * @param string $sender_name
32 * The name of the message sender.
34 public function setSenderName($sender_name);
37 * Returns the email address of the sender.
40 * The email address of the message sender.
42 public function getSenderMail();
45 * Sets the email address of the sender.
47 * @param string $sender_mail
48 * The email address of the message sender.
50 public function setSenderMail($sender_mail);
53 * Returns the message subject.
56 * The message subject.
58 public function getSubject();
61 * Sets the subject for the email.
63 * @param string $subject
64 * The message subject.
66 public function setSubject($subject);
69 * Returns the message body.
74 public function getMessage();
77 * Sets the email message to send.
79 * @param string $message
82 public function setMessage($message);
85 * Returns TRUE if a copy should be sent to the sender.
88 * TRUE if a copy should be sent, FALSE if not.
90 public function copySender();
93 * Sets if the sender should receive a copy of this email or not.
96 * TRUE if a copy should be sent, FALSE if not.
98 public function setCopySender($inform);
101 * Returns TRUE if this is the personal contact form.
104 * TRUE if the message bundle is personal.
106 public function isPersonal();
109 * Returns the user this message is being sent to.
111 * @return \Drupal\user\UserInterface
112 * The user entity of the recipient, NULL if this is not a personal message.
114 public function getPersonalRecipient();