Skip to Content Skip to Menu

Email instead of notification on Activity @Mention

  • jcrimmel
  • jcrimmel
  • OFFLINE
  • Posts: 44
  • Thanks: 9
  • Karma: 2
2 months 2 weeks ago #339077 by jcrimmel
Is it possible to email a user when they have been @mentioned in an Activity post? I can only configure it to notify using the site notification. Just wanted to be sure I wasn't missing somethng.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48541
  • Thanks: 8290
  • Karma: 1445
2 months 1 week ago #339083 by krileon
Not out of the box, no. You'd need to use CB Auto Actions for that. Easiest way to do that for mentions is to act on the mentions trigger. The below should work.

Global
Triggers: activity_onAfterCreateActivityStreamMention
Type: Email
Access: Everybody
User: Automatic
Action
To: [var3_user_id]
Subject: You were mentioned in a post!
Body:
Code:
You were mentioned <a href="DOMAIN_HERE/index.php?option=com_comprofiler&view=pluginclass&plugin=cbactivity&action=activity&id=[var2_id]">in this post</a>.

That triggers variables are as follows.

var1 = activity stream object
var2 = activity post object
var3 = mentioned object

With CB 3.x we'll be working on a centralized notification system so users can subscribe to specific notifications for email, pms, sms, or on-site. So hopefully this will become less cumbersome to setup in future releases.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
The following user(s) said Thank You: jcrimmel, robster80

Please Log in or Create an account to join the conversation.

  • robster80
  • robster80
  • OFFLINE
  • Posts: 46
  • Thanks: 5
  • Karma: 0
2 months 4 days ago #339157 by robster80
Hi,
I also needed this. I used this instruction and everything works. I am now wondering on the fact that there are times when someone will frown and delete an entry after it has been added. Is it possible to delay this mechanism for e.g. one minute, check after this time if the activity with the mention still exists and only then send an email notification?
best regards,
Robert.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48541
  • Thanks: 8290
  • Karma: 1445
2 months 4 days ago #339159 by krileon
There is no way to delay the email. CB 3.x will come with a built in processing queue where it will then be possible to do that, but for now the only way would be an external service for delayed sending of emails.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • robster80
  • robster80
  • OFFLINE
  • Posts: 46
  • Thanks: 5
  • Karma: 0
2 months 4 days ago #339160 by robster80
Thank you,
please suggest how to modify this action to include e.g. the first 40 characters from the activity in the message.
best regards,
Robert.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48541
  • Thanks: 8290
  • Karma: 1445
2 months 4 days ago #339163 by krileon
var2 is the activity post so you should be able to get the messages with [var2_message]. To truncate it under the Parameters tab enable Format Functions and review the functions at the bottom as there are several for inline modifying of content.

The message will be raw stored value though, which may not really be ideal for emails as it could contain stickers, smiles, gifs, etc.. that aren't compatible with emails. Instead you can probably grab the notification title of the activity post that would be more ideal for emails. To do that simply use the below format function.
Code:
[cb:parse function="getNotificationTitle" class="var2" /]

The getNotificationTitle function is already truncated to 50 characters by default and strips out stickers, etc.. so it's safe for emails.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
The following user(s) said Thank You: robster80

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum