Auto action when user receives PM

1 year 2 months ago #332453 by liaskas
Auto action when user receives PM was created by liaskas
Hello

I know that the internal PM plugin can be set to send mail notifications to users that receive a PM. With this setting enabled, our system will send an e-mail to all of our registered users when they receive a PM.

Our site is used by aprox 7000 users per day that communicate by PM. You can understand that the volume of the sending mails because of received PMs is too high and this has caused our site to be blacklisted twice for spamming. This is why right now we have completely disabled the notification by mail on PMs.

But not sending mail notifications for PMs when a site is Business oriented is not the best practice! You need your users to be notified by mail so that they are always inside the website.

So we thought if there is a way to use an auto action that will send notification mails to users when they receive a PM if some conditions are met.

Example of conditions
Recipient mail is not gmail.com, yahoo.com or hotmail.com

We want to send mail notifications (at first) only to companies that are registered with their company domain e-mail (xxx@theirdomain.com)

Can this be done with an auto action and how?

Thank you in advance.
 

Please Log in to join the conversation.

1 year 2 months ago #332465 by krileon
Replied by krileon on topic Auto action when user receives PM
Yes that's doable. You can send your custom email notification on the pm_onAfterCreateMessage trigger. Directly after that is actually where the PMS has its notification handling.

None of our notifications except CBSubs Mailer are designed for high volume like that (thousands per day). My recommendation is probably to offload the emailing to a 3rd party messaging service or consider using an external mail server with high ratings (e.g. Amazon SES).


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 to join the conversation.

1 year 2 months ago #332469 by liaskas
Replied by liaskas on topic Auto action when user receives PM
Than you for your reply Krileon.

I have created the auto action and it is sending the mails fine, but it does not seem to respect one of my auto action conditions...
I do not want mails to be sent to users registered with gmail.com and hotmail.com mails.

So i set this condition in my auto action...

Field: Value
Custom value: [email]
Operator: Does not contain
Deliimiter: ,
Value: gmail,hotmail

This does not work!

Also tried with...
Field: email
User: Action User
Operator: Does not contain
Deliimiter: ,
Value: gmail,hotmail

Does not work either.

Can you please advise?

Please Log in to join the conversation.

1 year 2 months ago #332477 by krileon
Replied by krileon on topic Auto action when user receives PM
Contains operators apply their delimiter to the field not to the value as explained the delimiter parameter description. Delimiter usages work by exploding by the delimiter then checking if a value is in the resulting array. For your usage you should be using a REGEXP operator and write the necessary REGEXP to exclude those domains since you're needing to match against more than 1. The alternative is use multiple contains conditions via OR conditions and leave delimiter empty so it just does a string search.


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 to join the conversation.

1 year 2 months ago #332503 by liaskas
Replied by liaskas on topic Auto action when user receives PM
Hello Krileon
Tried both ways...
1. use multiple contains conditions via OR conditions

Auto action conditions
Field: Value
Custom Value: [cb_notif_pm]
Operator: Not equal to
Value: 0

AND

Field: Value
Custom: [email]
Operator: Does not contain
Delimiter: (empty)
Value: gmail

OR

Another set like the above but with hotmail instead of gmail.

Worked only for the first conditionset. It was stopping only gmail. (Checked everything... from "hotmail" spellcheck to cache cleaning. It did not work for the second conditionset.

Then i thought of taking my chanses with the second way you proposed...

2. write the necessary REGEXP to exclude those domains

Auto action conditions
Field: Value
Custom Value: [cb_notif_pm]
Operator: Not equal to
Value: 0

AND

Field: Value
Custom: [email]
Operator: Is Not REGEX
Value: /(?<!\S)(@gmail|@hotmail|@outlook|@yahoo)\b/g
(tested the REGEX here regex101.com and it works fine)

No... it is not working even with the REGEX condition.

Am  doing something wrong?
 

Please Log in to join the conversation.

1 year 2 months ago #332507 by krileon
Replied by krileon on topic Auto action when user receives PM
The below should work fine

Field: Custom > Value
Custom Value: [email]
Operator: Is Not REGEXP
Value: /@(gmail|hotmail|outlook|yahoo)\.com/

Add as many domains as you like by separating with |.


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 to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.215 seconds

Facebook Twitter LinkedIn