Commit d0107d49 authored by webchick's avatar webchick

Issue #950534 by mparker17, mgifford, Mixologic, jbloomfield, erinclerico,...

Issue #950534 by mparker17, mgifford, Mixologic, jbloomfield, erinclerico, theMusician, wmostrey | zirvap: [policy] Consistently use email instead of e-mail in Drupal.
parent 95725e29
......@@ -115,7 +115,7 @@ Drupal 8.0, xxxx-xx-xx (development version)
forms for any configuration.
* Reworked Gettext PO support to use pluggable read/write handlers.
* Added language select form element in the Form API.
- Added E-mail field type to core.
- Added Email field type to core.
- Added Link field type to core.
- Added Phone number field type to core.
- Added local image input filter, to enable secure image posting.
......@@ -223,7 +223,7 @@ Drupal 7.0, 2011-01-05
user roles and permissions.
* Refactored the "access rules" component of user module: The user module
now provides a simple interface for blocking single IP addresses. The
previous functionality in the user module for restricting certain e-mail
previous functionality in the user module for restricting certain email
addresses and usernames is now available as a contributed module. Further,
IP address range blocking is no longer supported and should be implemented
at the operating system level.
......@@ -359,7 +359,7 @@ Drupal 6.0, 2008-02-13
default in the default installation profile.
* Extended the database log module so log messages can be filtered.
* Added syslog module: useful for monitoring large Drupal installations.
- Added optional e-mail notifications when users are approved, blocked, or
- Added optional email notifications when users are approved, blocked, or
deleted.
- Drupal works with error reporting set to E_ALL.
- Added scripts/drupal.sh to execute Drupal code from the command line. Useful
......@@ -541,7 +541,7 @@ Drupal 5.0, 2007-01-15
* 'Blogapi new' and 'blogapi edit' nodeapi operations.
- User module:
* Added hook_profile_alter().
* E-mail verification is made optional.
* Email verification is made optional.
* Added mass editing and filtering on admin/user/user.
- PHP Template engine:
* Add the ability to look for a series of suggested templates.
......@@ -766,7 +766,7 @@ Drupal 4.6.0, 2005-04-15
* Introduced forum configuration pages.
* Added a 'add child page' link to book pages.
- Contact module:
* Added a simple contact module that allows users to contact each other using e-mail.
* Added a simple contact module that allows users to contact each other using email.
- Multi-site configuration:
* Made it possible to run multiple sites from a single code base.
- Added an image API: enables better image handling.
......@@ -1113,7 +1113,7 @@ Drupal 3.0.0, 2001-09-15
* Improved scheduler:
+ Content can be scheduled to be 'posted', 'queued' and 'hidden'.
* Improved account module:
+ Added "access control" to allow/deny certain usernames/e-mail addresses/hostnames.
+ Added "access control" to allow/deny certain usernames/email addresses/hostnames.
* Improved locale module:
+ Added new overview to easy the translation process.
* Improved comment module:
......
......@@ -406,7 +406,7 @@ MORE INFORMATION
- For a list of security announcements, see the "Security advisories" page at
http://drupal.org/security (available as an RSS feed). This page also
describes how to subscribe to these announcements via e-mail.
describes how to subscribe to these announcements via email.
- For information about the Drupal security process, or to find out how to
report a potential security issue to the Drupal security team, see the
......
......@@ -279,7 +279,7 @@ Database Logging module
DateTime module
- ?
E-mail module
Email module
- Nils Destoop 'zuuperman' https://drupal.org/user/361625
Editor module
......
......@@ -349,13 +349,13 @@ function drupal_get_destination() {
*/
/**
* Verifies the syntax of the given e-mail address.
* Verifies the syntax of the given email address.
*
* This uses the
* @link http://php.net/manual/filter.filters.validate.php PHP e-mail validation filter. @endlink
* @link http://php.net/manual/filter.filters.validate.php PHP email validation filter. @endlink
*
* @param $mail
* A string containing an e-mail address.
* A string containing an email address.
*
* @return
* TRUE if the address is in a valid format.
......
......@@ -2484,7 +2484,7 @@ function form_validate_email(&$element, &$form_state) {
form_set_value($element, $value, $form_state);
if ($value !== '' && !valid_email_address($value)) {
form_error($element, $form_state, t('The e-mail address %mail is not valid.', array('%mail' => $value)));
form_error($element, $form_state, t('The email address %mail is not valid.', array('%mail' => $value)));
}
}
......
......@@ -2,7 +2,7 @@
/**
* @file
* API functions for processing and sending e-mail.
* API functions for processing and sending email.
*/
use Drupal\Component\Utility\Html;
......@@ -10,32 +10,32 @@
use Drupal\Core\Site\Settings;
/**
* Composes and optionally sends an e-mail message.
* Composes and optionally sends an email message.
*
* Sending an e-mail works with defining an e-mail template (subject, text
* and possibly e-mail headers) and the replacement values to use in the
* appropriate places in the template. Processed e-mail templates are
* requested from hook_mail() from the module sending the e-mail. Any module
* can modify the composed e-mail message array using hook_mail_alter().
* Finally drupal_mail_system()->mail() sends the e-mail, which can
* be reused if the exact same composed e-mail is to be sent to multiple
* Sending an email works with defining an email template (subject, text
* and possibly email headers) and the replacement values to use in the
* appropriate places in the template. Processed email templates are
* requested from hook_mail() from the module sending the email. Any module
* can modify the composed email message array using hook_mail_alter().
* Finally drupal_mail_system()->mail() sends the email, which can
* be reused if the exact same composed email is to be sent to multiple
* recipients.
*
* Finding out what language to send the e-mail with needs some consideration.
* If you send e-mail to a user, her preferred language should be fine, so
* Finding out what language to send the email with needs some consideration.
* If you send email to a user, her preferred language should be fine, so
* use user_preferred_langcode(). If you send email based on form values
* filled on the page, there are two additional choices if you are not
* sending the e-mail to a user on the site. You can either use the language
* sending the email to a user on the site. You can either use the language
* used to generate the page or the site default language. See
* language_default(). The former is good if sending e-mail to the person
* filling the form, the later is good if you send e-mail to an address
* language_default(). The former is good if sending email to the person
* filling the form, the later is good if you send email to an address
* previously set up (like contact addresses in a contact form).
*
* Taking care of always using the proper language is even more important
* when sending e-mails in a row to multiple users. Hook_mail() abstracts
* when sending emails in a row to multiple users. Hook_mail() abstracts
* whether the mail text comes from an administrator setting or is
* static in the source code. It should also deal with common mail tokens,
* only receiving $params which are unique to the actual e-mail at hand.
* only receiving $params which are unique to the actual email at hand.
*
* An example:
*
......@@ -85,23 +85,23 @@
* called to complete the $message structure which will already contain common
* defaults.
* @param string $key
* A key to identify the e-mail sent. The final message ID for e-mail altering
* A key to identify the email sent. The final message ID for email altering
* will be {$module}_{$key}.
* @param string $to
* The e-mail address or addresses where the message will be sent to. The
* The email address or addresses where the message will be sent to. The
* formatting of this string will be validated with the
* @link http://php.net/manual/filter.filters.validate.php PHP e-mail validation filter. @endlink
* @link http://php.net/manual/filter.filters.validate.php PHP email validation filter. @endlink
* Some examples are:
* - user@example.com
* - user@example.com, anotheruser@example.com
* - User <user@example.com>
* - User <user@example.com>, Another User <anotheruser@example.com>
* @param string $langcode
* Language code to use to compose the e-mail.
* Language code to use to compose the email.
* @param array $params
* (optional) Parameters to build the e-mail.
* (optional) Parameters to build the email.
* @param string|null $reply
* Optional e-mail address to be used to answer.
* Optional email address to be used to answer.
* @param bool $send
* If TRUE, drupal_mail() will call drupal_mail_system()->mail() to deliver
* the message, and store the result in $message['result']. Modules
......@@ -111,7 +111,7 @@
* @return
* The $message array structure containing all details of the
* message. If already sent ($send = TRUE), then the 'result' element
* will contain the success indicator of the e-mail, failure being already
* will contain the success indicator of the email, failure being already
* written to the watchdog. (Success means nothing more than the message being
* accepted at php-level, which still doesn't guarantee it to be delivered.)
*/
......@@ -144,7 +144,7 @@ function drupal_mail($module, $key, $to, $langcode, $params = array(), $reply =
'Content-Transfer-Encoding' => '8Bit',
'X-Mailer' => 'Drupal'
);
// To prevent e-mail from looking like spam, the addresses in the Sender and
// To prevent email from looking like spam, the addresses in the Sender and
// Return-Path headers should have a domain authorized to use the
// originating SMTP server.
$headers['Sender'] = $headers['Return-Path'] = $site_mail;
......@@ -154,7 +154,7 @@ function drupal_mail($module, $key, $to, $langcode, $params = array(), $reply =
}
$message['headers'] = $headers;
// Build the e-mail (get subject and body, allow additional headers) by
// Build the email (get subject and body, allow additional headers) by
// invoking hook_mail() on this module. We cannot use
// moduleHandler()->invoke() as we need to have $message by reference in
// hook_mail().
......@@ -162,7 +162,7 @@ function drupal_mail($module, $key, $to, $langcode, $params = array(), $reply =
$function($key, $message, $params);
}
// Invoke hook_mail_alter() to allow all modules to alter the resulting e-mail.
// Invoke hook_mail_alter() to allow all modules to alter the resulting email.
\Drupal::moduleHandler()->alter('mail', $message);
// Retrieve the responsible implementation for this message.
......@@ -171,7 +171,7 @@ function drupal_mail($module, $key, $to, $langcode, $params = array(), $reply =
// Format the message body.
$message = $system->format($message);
// Optionally send e-mail.
// Optionally send email.
if ($send) {
// The original caller requested sending. Sending was canceled by one or
// more hook_mail_alter() implementations. We set 'result' to NULL, because
......@@ -184,8 +184,8 @@ function drupal_mail($module, $key, $to, $langcode, $params = array(), $reply =
$message['result'] = $system->mail($message);
// Log errors.
if (!$message['result']) {
watchdog('mail', 'Error sending e-mail (from %from to %to with reply-to %reply).', array('%from' => $message['from'], '%to' => $message['to'], '%reply' => $message['reply-to'] ? $message['reply-to'] : t('not set')), WATCHDOG_ERROR);
drupal_set_message(t('Unable to send e-mail. Contact the site administrator if the problem persists.'), 'error');
watchdog('mail', 'Error sending email (from %from to %to with reply-to %reply).', array('%from' => $message['from'], '%to' => $message['to'], '%reply' => $message['reply-to'] ? $message['reply-to'] : t('not set')), WATCHDOG_ERROR);
drupal_set_message(t('Unable to send email. Contact the site administrator if the problem persists.'), 'error');
}
}
}
......@@ -199,7 +199,7 @@ function drupal_mail($module, $key, $to, $langcode, $params = array(), $reply =
* @param string $module
* The module name which was used by drupal_mail() to invoke hook_mail().
* @param string $key
* A key to identify the e-mail sent. The final message ID for the e-mail
* A key to identify the email sent. The final message ID for the email
* alter hook in drupal_mail() would have been {$module}_{$key}.
*
* @return \Drupal\Core\Mail\MailInterface
......@@ -448,7 +448,7 @@ function drupal_html_to_text($string, $allowed_tags = NULL) {
* Note that we are skipping MIME content header lines, because attached files,
* especially applications, could have long MIME types or long filenames which
* result in line length longer than the 77 characters limit and wrapping that
* line will break the e-mail format. E.g., the attached file hello_drupal.docx
* line will break the email format. E.g., the attached file hello_drupal.docx
* will produce the following Content-Type:
* Content-Type:
* application/vnd.openxmlformats-officedocument.wordprocessingml.document;
......
......@@ -16,8 +16,8 @@
*
* @FieldType(
* id = "email",
* label = @Translation("E-mail"),
* description = @Translation("An entity field containing an e-mail value."),
* label = @Translation("Email"),
* description = @Translation("An entity field containing an email value."),
* default_widget = "email_default",
* default_formatter = "string"
* )
......@@ -29,7 +29,7 @@ class EmailItem extends FieldItemBase {
*/
public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) {
$properties['value'] = DataDefinition::create('email')
->setLabel(t('E-mail value'));
->setLabel(t('Email value'));
return $properties;
}
......@@ -60,7 +60,7 @@ public function getConstraints() {
'value' => array(
'Length' => array(
'max' => EMAIL_MAX_LENGTH,
'maxMessage' => t('%name: the e-mail address can not be longer than @max characters.', array('%name' => $this->getFieldDefinition()->getLabel(), '@max' => EMAIL_MAX_LENGTH)),
'maxMessage' => t('%name: the email address can not be longer than @max characters.', array('%name' => $this->getFieldDefinition()->getLabel(), '@max' => EMAIL_MAX_LENGTH)),
)
),
));
......
......@@ -15,7 +15,7 @@
*
* @FieldWidget(
* id = "email_default",
* label = @Translation("E-mail"),
* label = @Translation("Email"),
* field_types = {
* "email"
* }
......
......@@ -135,9 +135,9 @@ public function buildForm(array $form, array &$form_state) {
);
$form['site_information']['site_mail'] = array(
'#type' => 'email',
'#title' => $this->t('Site e-mail address'),
'#title' => $this->t('Site email address'),
'#default_value' => ini_get('sendmail_from'),
'#description' => $this->t("Automated e-mails, such as registration information, will be sent from this address. Use an address ending in your site's domain to help prevent these e-mails from being flagged as spam."),
'#description' => $this->t("Automated emails, such as registration information, will be sent from this address. Use an address ending in your site's domain to help prevent these emails from being flagged as spam."),
'#required' => TRUE,
'#weight' => -15,
);
......@@ -149,7 +149,7 @@ public function buildForm(array $form, array &$form_state) {
$form['admin_account']['account']['#tree'] = TRUE;
$form['admin_account']['account']['mail'] = array(
'#type' => 'email',
'#title' => $this->t('E-mail address'),
'#title' => $this->t('Email address'),
'#required' => TRUE,
);
$form['admin_account']['account']['name'] = array(
......@@ -199,7 +199,7 @@ public function buildForm(array $form, array &$form_state) {
'#title' => $this->t('Update notifications'),
'#options' => array(
1 => $this->t('Check for updates automatically'),
2 => $this->t('Receive e-mail notifications'),
2 => $this->t('Receive email notifications'),
),
'#default_value' => array(1, 2),
'#description' => $this->t('The system will notify you when updates and important security releases are available for installed components. Anonymous information about your site is sent to <a href="@drupal">Drupal.org</a>.', array('@drupal' => 'http://drupal.org')),
......
......@@ -36,20 +36,20 @@ public function format(array $message);
*
* @param array $message
* Message array with at least the following elements:
* - id: A unique identifier of the e-mail type. Examples: 'contact_user_copy',
* - id: A unique identifier of the email type. Examples: 'contact_user_copy',
* 'user_password_reset'.
* - to: The mail address or addresses where the message will be sent to.
* The formatting of this string will be validated with the
* @link http://php.net/manual/filter.filters.validate.php PHP e-mail validation filter. @endlink
* @link http://php.net/manual/filter.filters.validate.php PHP email validation filter. @endlink
* Some examples:
* - user@example.com
* - user@example.com, anotheruser@example.com
* - User <user@example.com>
* - User <user@example.com>, Another User <anotheruser@example.com>
* - subject: Subject of the e-mail to be sent. This must not contain any
* - subject: Subject of the email to be sent. This must not contain any
* newline characters, or the mail may not be sent properly.
* - body: Message to be sent. Accepts both CRLF and LF line-endings.
* E-mail bodies must be wrapped. You can use drupal_wrap_mail() for
* Email bodies must be wrapped. You can use drupal_wrap_mail() for
* smart plain text wrapping.
* - headers: Associative array containing all additional mail headers not
* defined by one of the other parameters. PHP's mail() looks for Cc and
......
......@@ -22,7 +22,7 @@
class PhpMail implements MailInterface {
/**
* Concatenates and wraps the e-mail body for plain-text mails.
* Concatenates and wraps the email body for plain-text mails.
*
* @param array $message
* A message array, as described in hook_mail_alter().
......@@ -42,7 +42,7 @@ public function format(array $message) {
}
/**
* Sends an e-mail message.
* Sends an email message.
*
* @param array $message
* A message array, as described in hook_mail_alter().
......@@ -70,7 +70,7 @@ public function mail(array $message) {
$line_endings = Settings::get('mail_line_endings', PHP_EOL);
// Prepare mail commands.
$mail_subject = mime_header_encode($message['subject']);
// Note: e-mail uses CRLF for line-endings. PHP's API requires LF
// Note: email uses CRLF for line-endings. PHP's API requires LF
// on Unix and CRLF on Windows. Drupal automatically guesses the
// line-ending format appropriate for your system. If you need to
// override this, adjust $settings['mail_line_endings'] in settings.php.
......
......@@ -130,10 +130,10 @@ public function getPreferredAdminLangcode($default = NULL);
public function getUsername();
/**
* Returns the e-mail address of this account.
* Returns the email address of this account.
*
* @return string
* The e-mail address.
* The email address.
*/
public function getEmail();
......
......@@ -80,7 +80,7 @@ class UserSession implements AccountInterface {
protected $preferred_admin_langcode;
/**
* The e-mail address of this account.
* The email address of this account.
*
* @var string
*/
......
......@@ -102,7 +102,7 @@ public function registerDefinitions() {
'type' => FALSE,
));
$this->discovery->setDefinition('Email', array(
'label' => t('E-mail'),
'label' => t('Email'),
'class' => '\Symfony\Component\Validator\Constraints\Email',
'type' => array('string'),
));
......
......@@ -15,18 +15,18 @@ function action_help($route_name, Request $request) {
case 'help.page.action':
$output = '';
$output .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . t('The Action module provides tasks that can be executed by the site such as unpublishing content, sending e-mail messages, or blocking a user. Other modules can trigger these actions when specific system events happen; for example, when new content is posted or when a user logs in. Modules can also provide additional actions. For more information, see the <a href="!documentation">online documentation for the Action module</a>.', array('!documentation' => 'https://drupal.org/documentation/modules/action')) . '</p>';
$output .= '<p>' . t('The Action module provides tasks that can be executed by the site such as unpublishing content, sending email messages, or blocking a user. Other modules can trigger these actions when specific system events happen; for example, when new content is posted or when a user logs in. Modules can also provide additional actions. For more information, see the <a href="!documentation">online documentation for the Action module</a>.', array('!documentation' => 'https://drupal.org/documentation/modules/action')) . '</p>';
$output .= '<h3>' . t('Uses') . '</h3>';
$output .= '<dl>';
$output .= '<dt>' . t('Using simple actions') . '</dt>';
$output .= '<dd>' . t('<em>Simple actions</em> do not require configuration and are listed automatically as available on the <a href="!actions">Actions page</a>.', array('!actions' => \Drupal::url('action.admin'))) . '</dd>';
$output .= '<dt>' . t('Creating and configuring advanced actions') . '</dt>';
$output .= '<dd>' . t('<em>Advanced actions</em> are user-created and have to be configured individually. Create an advanced action on the <a href="!actions">Actions page</a> by selecting an action type from the drop-down list. Then configure your action, for example by specifying the recipient of an automated e-mail message.', array('!actions' => \Drupal::url('action.admin'))) . '</dd>';
$output .= '<dd>' . t('<em>Advanced actions</em> are user-created and have to be configured individually. Create an advanced action on the <a href="!actions">Actions page</a> by selecting an action type from the drop-down list. Then configure your action, for example by specifying the recipient of an automated email message.', array('!actions' => \Drupal::url('action.admin'))) . '</dd>';
$output .= '</dl>';
return $output;
case 'action.admin':
$output = '<p>' . t('There are two types of actions: simple and advanced. Simple actions do not require any additional configuration and are listed here automatically. Advanced actions need to be created and configured before they can be used because they have options that need to be specified; for example, sending an e-mail to a specified address or unpublishing content containing certain words. To create an advanced action, select the action from the drop-down list in the advanced action section below and click the <em>Create</em> button.') . '</p>';
$output = '<p>' . t('There are two types of actions: simple and advanced. Simple actions do not require any additional configuration and are listed here automatically. Advanced actions need to be created and configured before they can be used because they have options that need to be specified; for example, sending an email to a specified address or unpublishing content containing certain words. To create an advanced action, select the action from the drop-down list in the advanced action section below and click the <em>Create</em> button.') . '</p>';
return $output;
case 'action.admin_configure':
......
......@@ -11,7 +11,7 @@ action.settings:
action.configuration.action_send_email_action:
type: mapping
label: 'Send e-mail configuration'
label: 'Send email configuration'
mapping:
recipient:
type: string
......
......@@ -14,11 +14,11 @@
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
* Sends an e-mail message.
* Sends an email message.
*
* @Action(
* id = "action_send_email_action",
* label = @Translation("Send e-mail"),
* label = @Translation("Send email"),
* type = "system"
* )
*/
......@@ -120,7 +120,7 @@ public function buildConfigurationForm(array $form, array &$form_state) {
'#title' => t('Recipient'),
'#default_value' => $this->configuration['recipient'],
'#maxlength' => '254',
'#description' => t('The e-mail address to which the message should be sent OR enter [node:author:mail], [comment:author:mail], etc. if you would like to send an e-mail to the author of the original post.'),
'#description' => t('The email address to which the message should be sent OR enter [node:author:mail], [comment:author:mail], etc. if you would like to send an email to the author of the original post.'),
);
$form['subject'] = array(
'#type' => 'textfield',
......@@ -146,7 +146,7 @@ public function buildConfigurationForm(array $form, array &$form_state) {
public function validateConfigurationForm(array &$form, array &$form_state) {
if (!valid_email_address($form_state['values']['recipient']) && strpos($form_state['values']['recipient'], ':mail') === FALSE) {
// We want the literal %author placeholder to be emphasized in the error message.
form_set_error('recipient', $form_state, t('Enter a valid email address or use a token e-mail address such as %author.', array('%author' => '[node:author:mail]')));
form_set_error('recipient', $form_state, t('Enter a valid email address or use a token email address such as %author.', array('%author' => '[node:author:mail]')));
}
}
......
......@@ -52,7 +52,7 @@
// Use link URL as text with a collapsed cursor.
if (range.collapsed) {
// Shorten mailto URLs to just the e-mail address.
// Shorten mailto URLs to just the email address.
var text = new CKEDITOR.dom.text(returnValues.attributes.href.replace(/^mailto:/, ''), editor.document);
range.insertNode(text);
range.selectNodeContents(text);
......
......@@ -109,8 +109,8 @@ function comment_views_data() {
);
$data['comment']['mail'] = array(
'title' => t('E-mail'),
'help' => t('E-mail of user that posted the comment. Will be empty if the author is a registered user.'),
'title' => t('Email'),
'help' => t('Email of user that posted the comment. Will be empty if the author is a registered user.'),
'field' => array(
'id' => 'standard',
),
......
......@@ -156,10 +156,10 @@ public function form(array $form, array &$form_state) {
$form['author']['name']['#account'] = $this->currentUser;
}
// Add author e-mail and homepage fields depending on the current user.
// Add author email and homepage fields depending on the current user.
$form['author']['mail'] = array(
'#type' => 'email',
'#title' => $this->t('E-mail'),
'#title' => $this->t('Email'),
'#default_value' => $comment->getAuthorEmail(),
'#required' => ($this->currentUser->isAnonymous() && $anonymous_contact == COMMENT_ANONYMOUS_MUST_CONTACT),
'#maxlength' => 64,
......
......@@ -135,12 +135,12 @@ public function getAuthorName();
public function setAuthorName($name);
/**
* Returns the comment author's e-mail address.
* Returns the comment author's email address.
*
* For anonymous authors, this is the value as typed in the comment form.
*
* @return string
* The e-mail address of the author of the comment.
* The email address of the author of the comment.
*/
public function getAuthorEmail();
......
......@@ -249,7 +249,7 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
$fields['mail'] = FieldDefinition::create('email')
->setLabel(t('Email'))
->setDescription(t("The comment author's e-mail address."));
->setDescription(t("The comment author's email address."));
$fields['homepage'] = FieldDefinition::create('uri')
->setLabel(t('Homepage'))
......
......@@ -86,7 +86,7 @@ function testAnonymous() {
$anonymous_comment3 = $this->postComment($this->node, $this->randomName(), $this->randomName(), TRUE);
// Name should have 'Anonymous' for value by default.
$this->assertText(t('E-mail field is required.'), 'E-mail required.');
$this->assertText(t('Email field is required.'), 'Email required.');
$this->assertFalse($this->commentExists($anonymous_comment3), 'Anonymous comment with contact info (required) not found.');
// Post comment with contact info (required).
......@@ -99,7 +99,7 @@ function testAnonymous() {
$this->drupalLogin($this->admin_user);
$this->drupalGet('comment/' . $anonymous_comment3->id() . '/edit');
$this->assertRaw($author_name, "The anonymous user's name is correct when editing the comment.");
$this->assertRaw($author_mail, "The anonymous user's e-mail address is correct when editing the comment.");
$this->assertRaw($author_mail, "The anonymous user's email address is correct when editing the comment.");
// Unpublish comment.
$this->performCommentOperation($anonymous_comment3, 'unpublish');
......
......@@ -9,7 +9,7 @@ contact.category.*:
label: 'Recipients'
sequence:
- type: email
label: 'E-mail address'
label: 'Email address'
reply:
type: text
label: 'Auto-reply'
......
......@@ -14,13 +14,13 @@ function contact_help($route_name, Request $request) {
case 'help.page.contact':
$output = '';
$output .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . t('The Contact module allows visitors to contact site administrators and other users. Users specify a subject, write their message, and can have a copy of their message sent to their own e-mail address. For more information, see the online handbook entry for <a href="@contact">Contact module</a>.', array('@contact' => 'http://drupal.org/documentation/modules/contact')) . '</p>';
$output .= '<p>' . t('The Contact module allows visitors to contact site administrators and other users. Users specify a subject, write their message, and can have a copy of their message sent to their own email address. For more information, see the online handbook entry for <a href="@contact">Contact module</a>.', array('@contact' => 'http://drupal.org/documentation/modules/contact')) . '</p>';
$output .= '<h3>' . t('Uses') . '</h3>';
$output .= '<dl>';
$output .= '<dt>' . t('User contact forms') . '</dt>';
$output .= '<dd>' . t('Site users can be contacted with a user contact form that keeps their e-mail address private. Users may enable or disable their personal contact forms by editing their <em>My account</em> page. If enabled, a <em>Contact</em> tab leads to a personal contact form displayed on their user profile. Site administrators are still able to use the contact form, even if has been disabled. The <em>Contact</em> tab is not shown when you view your own profile.') . '</dd>';
$output .= '<dd>' . t('Site users can be contacted with a user contact form that keeps their email address private. Users may enable or disable their personal contact forms by editing their <em>My account</em> page. If enabled, a <em>Contact</em> tab leads to a personal contact form displayed on their user profile. Site administrators are still able to use the contact form, even if has been disabled. The <em>Contact</em> tab is not shown when you view your own profile.') . '</dd>';
$output .= '<dt>' . t('Site-wide contact forms') . '</dt>';
$output .= '<dd>' . t('The <a href="@contact">Contact page</a> provides a simple form for users with the <em>Use the site-wide contact form</em> permission to send comments, feedback, or other requests. You can create categories for directing the contact form messages to a set of defined recipients. Common categories for a business site, for example, might include "Website feedback" (messages are forwarded to website administrators) and "Product information" (messages are forwarded to members of the sales department). E-mail addresses defined within a category are not displayed publicly.', array('@contact' => url('contact'))) . '</p>';
$output .= '<dd>' . t('The <a href="@contact">Contact page</a> provides a simple form for users with the <em>Use the site-wide contact form</em> permission to send comments, feedback, or other requests. You can create categories for directing the contact form messages to a set of defined recipients. Common categories for a business site, for example, might include "Website feedback" (messages are forwarded to website administrators) and "Product information" (messages are forwarded to members of the sales department). Email addresses defined within a category are not displayed publicly.', array('@contact' => url('contact'))) . '</p>';
$output .= '<dt>' . t('Navigation') . '</dt>';
$output .= '<dd>' . t('When the site-wide contact form is enabled, a link in the <em>Footer</em> menu is created, which you can modify on the <a href="@menu">Menus administration page</a>.', array('@menu' => url('admin/structure/menu'))) . '</dd>';
$output .= '<dt>' . t('Customization') . '</dt>';
......@@ -73,8 +73,8 @@ function contact_entity_extra_field_info() {
'weight' => -50,
);
$fields['contact_message'][$bundle]['form']['mail'] = array(
'label' => t('Sender e-mail'),
'description' => t('E-mail'),
'label' => t('Sender email'),
'description' => t('Email'),
'weight' => -40,
);
if ($bundle == 'personal') {
......@@ -163,7 +163,7 @@ function contact_mail($key, &$message, $params) {
$message['subject'] .= t('[!site-name] !subject', $variables, $options);
$message['body'][] = t('Hello !recipient-name,', $variables, $options);
$message['body'][] = t("!sender-name (!sender-url) has sent you a message via your contact form at !site-name.", $variables, $options);
$message['body'][] = t("If you don't want to receive such e-mails, you can change your settings at !recipient-edit-url.", $variables, $options);
$message['body'][] = t("If you don't want to receive such emails, you can change your settings at !recipient-edit-url.", $variables, $options);
$build = entity_view($contact_message, 'mail', $language->id);
$message['body'][] = drupal_render($build);
break;
......@@ -192,7 +192,7 @@ function contact_form_user_form_alter(&$form, &$form_state) {
'#type' => 'checkbox',
'#title' => t('Personal contact form'),
'#default_value' => isset($account_data) ? $account_data : \Drupal::config('contact.settings')->get('user_default_enabled'),
'#description' => t('Allow other users to contact you via a personal contact form which keeps your e-mail address hidden. Note that some privileged users such as site administrators are still able to contact you even if you choose to disable this feature.'),
'#description' => t('Allow other users to contact you via a personal contact form which keeps your email address hidden. Note that some privileged users such as site administrators are still able to contact you even if you choose to disable this feature.'),
);
$form['actions']['submit']['#submit'][] = 'contact_user_profile_form_submit';
}
......
......@@ -45,7 +45,7 @@ public function form(array $form, array &$form_state) {
'#type' => 'textarea',
'#title' => t('Recipients'),
'#default_value' => implode(', ', $category->recipients),
'#description' => t("Example: 'webmaster@example.com' or 'sales@example.com,support@example.com' . To specify multiple recipients, separate each e-mail address with a comma."),
'#description' => t("Example: 'webmaster@example.com' or 'sales@example.com,support@example.com' . To specify multiple recipients, separate each email address with a comma."),
'#required' => TRUE,
);
$form['reply'] = array(
......@@ -80,13 +80,13 @@ public function form(array $form, array &$form_state) {
public function validate(array $form, array &$form_state) {
parent::validate($form, $form_state);
// Validate and each e-mail recipient.
// Validate and each email recipient.
$recipients = explode(',', $form_state['values']['recipients']);
foreach ($recipients as &$recipient) {
$recipient = trim($recipient);
if (!valid_email_address($recipient)) {
$this->setFormError('recipients', $form_state, $this->t('%recipient is an invalid e-mail address.', array('%recipient' => $recipient)));
$this->setFormError('recipients', $form_state, $this->t('%recipient is an invalid email address.', array('%recipient' => $recipient)));
}
}
$form_state['values']['recipients'] = $recipients;
......
......@@ -61,7 +61,7 @@ public static function create(ContainerInterface $container) {
* contact category form.
*/
public function contactSitePage(CategoryInterface $contact_category = NULL) {
// Check if flood control has been activated for sending e-mails.
// Check if flood control has been activated for sending emails.
if (!$this->currentUser()->hasPermission('administer contact forms')) {
$this->contactFloodControl();
}
......@@ -105,7 +105,7 @@ public function contactSitePage(CategoryInterface $contact_category = NULL) {
* The personal contact form as render array as expected by drupal_render().
*/
public function contactPersonalPage(UserInterface $user) {
// Check if flood control has been activated for sending e-mails.
// Check if flood control has been activated for sending emails.
if (!$this->currentUser()->hasPermission('administer contact forms') && !$this->currentUser()->hasPermission('administer users')) {
$this->contactFloodControl();
}
......
......@@ -57,7 +57,7 @@ class Category extends ConfigEntityBundleBase implements CategoryInterface {
public $label;
/**
* List of recipient e-mail addresses.
* List of recipient email addresses.
*
* @var array
*/
......
......@@ -83,14 +83,14 @@ public function form(array $form, array &$form_state) {
);
$form['mail'] = array(
'#type' => 'email',
'#title' => t('Your e-mail address'),
'#title' => t('Your email address'),
'#required' => TRUE,
);
if ($user->isAnonymous()) {
$form['#attached']['library'][] = 'core/jquery.cookie';
$form['#attributes']['class'][] = 'user-info-from-cookie';
}
// Do not allow authenticated users to alter the name or e-mail values to
// Do not allow authenticated users to alter the name or email values to
// prevent the impersonation of other users.
else {
$form['name']['#type'] = 'item';
......@@ -185,12 +185,12 @@ public function save(array $form, array &$form_state) {
$sender->mail = $message->getSenderMail();
// Save the anonymous user information to a cookie for reuse.
user_cookie_save(array('name' => $message->getSenderName(), 'mail' => $message->getSenderMail()));
// For the e-mail message, clarify that the sender name is not verified; it
// For the email message, clarify that the sender name is not verified; it
// could potentially clash with a username on this site.
$sender<