Admin Email on Registration

2 years 11 months ago #324540 by bizguy
Admin Email on Regiostration was created by bizguy
I am sending an email to an Admin onAfterSaveUserRegistration.

I want to include the Plan Name and Branch Name in the email (both are saved as numeric values in Comprofiler during registration).

Is there an easy way to convert these values to names in the email? I have a Query, updating a second set of fields within the plans with their names, but while the record is updated in the table, the email does not include the values.

I would have thought that creating the record is completed before the AutoAction onAfterSaveUserRegistration fires.
Thanks,

Ed

Please Log in to join the conversation.

2 years 11 months ago #324547 by krileon
Replied by krileon on topic Admin Email on Regiostration
If you enable content plugins for your email auto action under the Parameters tab you can use the following CBSubs substitution usage to include plan name in the email.

[cbsubs:plans plan="PLAN_ID_HERE" output="name" /]

It's best to surround this with an IF usage to make sure they actually have the plan though. Example as follows.

[cbsubs:if plan="PLAN_ID_HERE"]
[cbsubs:plans plan="PLAN_ID_HERE" output="name" /]
[/cbsubs:if]

You can then do this for each of your plans so the plan name is just automatically included and does not require storing the plan id with the users profile. For more CBSubs substitution usages review the cbpaidsubs bot within Extensions > Plugins and review its description carefully as it describes how to use its substitutions.

I've no idea what Branch Name is supposed to be so I don't know what to suggest for that.


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.

2 years 11 months ago #324553 by bizguy
Replied by bizguy on topic Admin Email on Registration
Thanks Kyle,

Using [cbsubs:plans plan=[plan_id] output="name" /] I was able to have the plan name included in emails for all plans.

I also moved the trigger to onCPayAfterPaymentStatusChange before reading this to allow the original save field value query to update the fields before sending the email.

The Branch Name is a single select query from an internal table. I tried using [cb:userfield field="cb_branch_region" /] but this only crashed sending the email.

Suggestion how to convert this is appreciated.

Ed

Please Log in to join the conversation.

2 years 11 months ago #324556 by krileon
Replied by krileon on topic Admin Email on Registration

The Branch Name is a single select query from an internal table. I tried using [cb:userfield field="cb_branch_region" /] but this only crashed sending the email.

If it's already a query field it shouldn't be a problem to just substitute in that query field. There isn't any reason for a query field to just crash unless there's something wrong with the query itself.


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.465 seconds

Facebook Twitter LinkedIn