×

Error

Please login first

How to exclude certain users from emails?

8 years 1 month ago #280127 by lousyfool
Hi,

This might sound strange, but I need to find a way to exclude certain users from any and all (!) system-generated emails being sent.
Maybe it's simple, but for now I'm struggling... so, thanks for some help, or at least pointers in the right direction.

So, I'm thinking to have a single checkbox CB profile field, like cb_no_emails.

I looked at Auto Action to see if I could prevent emails being sent if a condition is "[cb_no_emails] equal to 1".

For triggers the following read suitable:
- onBeforeEmailUser
- onBeforeSendEmailMSG
- onBeforeSendEmail
- onCPayBeforeMailerEmailMessageSent

If Auto Action is the way to go, then I'll probably need to use type Query to update/set some field(s) somewhere...

Leads to these questions:
1.) Is this generally possible with Auto Action and updating certain DB fields, or would it require hacking PHP?
2.) If AA, which triggers to use, and which tables/fields to aim at with the query?

Many thanks in advance for the briefest reply!


P.S.:
Thinking about it, it could maybe be a future option in CB Privacy to let users decide if they want to continue getting mails or not. There are quite a few people out there who want to be part of something (like a community) but not be bothered by more or less frequent emails.
Take it as a feature request? ;)

Please Log in to join the conversation.

8 years 1 month ago #280148 by krileon
Replied by krileon on topic How to exclude certain users from emails?
CB is not a newsletter extension. Opt-out of system emails is not and will not be possible. Eventually CB Notifications (possibly built into CB, unsure at this time) will be developed to allow opt-in/out of site notifications (GJ already allows this for its notifications).

There's no way to globally turn off emails per user. The triggers associated with the mailer won't allow this to function unless you error the mailer, but doing so will likely throw an error anywhere the mailer is required.

What emails exactly are you trying to exclude them from?


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: lousyfool

Please Log in to join the conversation.

8 years 1 month ago #280157 by lousyfool
Replied by lousyfool on topic How to exclude certain users from emails?
Thanks again for your reply and the explanations.

krileon wrote: What emails exactly are you trying to exclude them from?


It's mostly, if not all, the mails related to CBSubs: on plan activation/renewal/expiration (incl advance reminders)/deactivation, etc.

Should I maybe consider using usergroups to separate those users who must be excluded, and then not use the mails in CBSubs' general settings or per plan, but instead for each and everything the separate "CBSubs Mailer" plugin, in which I can set the usergroups? Looks like a viable workaround to me... what do you say?

Please Log in to join the conversation.

8 years 1 month ago #280170 by krileon
Replied by krileon on topic How to exclude certain users from emails?
Best I can suggest is replace those emails with CBSubs Mailer usages (you'll need to run the mailer queue daily with CRON) and have it condition against your field to allow them to exclude themselves from such emails. However, those are system emails and really shouldn't allow opt-out.


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: lousyfool

Please Log in to join the conversation.

8 years 1 month ago #280172 by lousyfool
Replied by lousyfool on topic How to exclude certain users from emails?
Thanks Kyle,

I'll see what'll take less time and effort: setting it all up in Mailer or convincing the client... :dry: ;)

Please Log in to join the conversation.

8 years 1 month ago #280194 by nant

lousyfool wrote: Thanks Kyle,

I'll see what'll take less time and effort: setting it all up in Mailer or convincing the client... :dry: ;)


Another solution would be to just add a new CB opt-out field (check box field) and configure your mailers to not send if people have checked this field.
The following user(s) said Thank You: lousyfool

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.201 seconds

Facebook Twitter LinkedIn