Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

You've Got Mail #20162

Merged
merged 4 commits into from
Apr 29, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
You've Got Mail
Since 2003 the internet has changed. We no longer get a message to say that we have a message. Instead we just give you the message. You probably never use the messages component (especially for private message to a specific user) as they are the equivalent of https://www.youtube.com/watch?v=gFBLiHpkcOk

The Joomla com_messages component is used in two instances

1. Notification of a new article
2. Sending a message to another user

### Current email for Notification of a new article
Subject: A new private message has arrived from [sitename]
Body:
> Please log in to [link] to read your message.

### New email for Notification of a new article
Subject: New message from [user] at [sitename]
Body:
> New Article
A new Article has been submitted by 'user' entitled 'blog post'.
> Please log in to [link] to read your message.

### Current email when sending a message to another user
Subject: A new private message has arrived from [sitename]
Body:
> Please log in to [link] to read your message.

### New email when sending a message to another user
Subject: New message from [user] at [sitename]
Body:
> [subject]
 [message]
[login link]

## Backwards Compatibility
No issues. The message contains the old login message PLUS the content of the message. So if you were using this message in a custom workflow there is no change required to that workflow
  • Loading branch information
brianteeman committed Apr 13, 2018
commit 68b1d8b5bbfb11408447fe990f7d3c7f77a9e1d5
8 changes: 6 additions & 2 deletions administrator/components/com_messages/models/message.php
Original file line number Diff line number Diff line change
Expand Up @@ -359,9 +359,13 @@ public function save($data)

// Build the email subject and message
$sitename = JFactory::getApplication()->get('sitename');
$fromName = $fromUser->get('name');
$siteURL = JUri::root() . 'administrator/index.php?option=com_messages&view=message&message_id=' . $table->message_id;
$subject = sprintf($lang->_('COM_MESSAGES_NEW_MESSAGE_ARRIVED'), $sitename);
$msg = sprintf($lang->_('COM_MESSAGES_PLEASE_LOGIN'), $siteURL);
$title = html_entity_decode($table->subject, ENT_COMPAT, 'UTF-8');
$message = strip_tags(html_entity_decode($table->message, ENT_COMPAT, 'UTF-8'));

$subject = sprintf($lang->_('COM_MESSAGES_NEW_MESSAGE_ARRIVED'), $fromName, $sitename );
$msg = $title . "\n\n" . $message . "\n\n" . sprintf($lang->_('COM_MESSAGES_PLEASE_LOGIN'), $siteURL);

// Send the email
$mailer = JFactory::getMailer();
Expand Down
2 changes: 1 addition & 1 deletion administrator/language/en-GB/en-GB.com_messages.ini
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ COM_MESSAGES_N_ITEMS_TRASHED="%d messages trashed."
COM_MESSAGES_N_ITEMS_TRASHED_1="Message trashed."
COM_MESSAGES_N_ITEMS_UNPUBLISHED="%d messages marked as unread."
COM_MESSAGES_N_ITEMS_UNPUBLISHED_1="Message marked as unread."
COM_MESSAGES_NEW_MESSAGE_ARRIVED="A new private message has arrived from %s"
COM_MESSAGES_NEW_MESSAGE_ARRIVED="New Message from %1$s at %2$s"
COM_MESSAGES_NO_ITEM_SELECTED="No messages selected."
COM_MESSAGES_OPTION_READ="Read"
COM_MESSAGES_OPTION_UNREAD="Unread"
Expand Down