Commit 4ef4a91e authored by jhedstrom's avatar jhedstrom

Use mail_subject instead of mail_title

parent 7c87bc41
......@@ -3,7 +3,7 @@ status: true
dependencies:
module:
- message
id: message.mail_title
id: message.mail_subject
label: 'Notify - Email subject'
targetEntityType: message
cache: true
......@@ -10,7 +10,7 @@
* Set's the message subject and body as configured.
*/
function message_notify_mail($key, &$message, $params) {
$message['subject'] = $params['mail_title'];
$message['subject'] = $params['mail_subject'];
$message['body'][] = $params['mail_body'];
}
......@@ -30,8 +30,8 @@ function message_notify_entity_bundle_create($entity_type_id, $bundle) {
$default = entity_get_display($entity_type_id, $bundle, 'default');
// Setup the subject/title display mode if it doesn't exist.
if (!$storage->load($entity_type_id . '.' . $bundle . '.mail_title')) {
$display = $default->createCopy('mail_title');
if (!$storage->load($entity_type_id . '.' . $bundle . '.mail_subject')) {
$display = $default->createCopy('mail_subject');
$display->set('content', ['partial_0' => ['weight' => 0]]);
$display->set('hidden', ['partial_1' => TRUE]);
$display->save();
......
......@@ -19,7 +19,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
* title = @Translation("Email"),
* description = @Translation("Send messages via email"),
* view_modes = {
* "mail_title",
* "mail_subject",
* "mail_body"
* }
* )
......@@ -83,7 +83,7 @@ class Email extends MessageNotifierBase {
// The subject in an email can't be with HTML, so strip it.
// @todo Centralize rendering.
$output['mail_title'] = strip_tags($output['mail_title']['#markup']);
$output['mail_subject'] = strip_tags($output['mail_subject']['#markup']);
$output['mail_body'] = $output['mail_body']['#markup'];
// Pass the message entity along to hook_drupal_mail().
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment