Help with Welcome Emails


I'm having some real difficulties figuring out how to get Welcome Emails to work. I have newletters enabled, so the functionality for tempcode (or parameters) should work. In particular, I would like to have the Welcome Email personalized so that the name (or firstname) will appear.
For example, I would like —
Dear {name},
to have the {name} parameter be changed to the name of the person receiving the email. This is not happening. It appears just as entered. I would also like to have parameters for {username} and {password} filled in properly as well. But again, no parameters are getting filled in…so I'm assuming they are not getting passed?
Another problem I'm noticing is that when I preview the body of the email, I am getting two error messages:


I looked inside the newsletter.ini and these two language strings do exist, so I have no idea why I'm getting these messages. But they are messing up the bottom of the emails where the user should be able to opt out of the subscription. Any ideas why this is happening?
When previewing the Welcome email I am receiving the emails via SMTP but without the parameters variables being replaced.
Thanks in advance for any assistance you can offer. Much appreciated.
Best,
Christopher
Last edit: by cwdean


This looks like a bug, and possibly a misunderstanding. I'll look into it soon for you.
Become a fan of Composr on Facebook or add me as a friend. Add me on on Mastodon. Follow me on Minds (where I am most active). Support me on Patreon
- If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
- If so, please let others know about Composr whenever you see the opportunity or support me on Patreon.
- If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying Composr on fun personal projects.
- If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.


Thanks for the quick response. If there is anything I can do to help with testing any changes or fixes, please let me know. I'm happy to help any way that I can.
I'm currently setting up my Homeowners Association community we site using Composr and was looking forward to using the Welcome Email capability to introduce new members to the site and provide them with a temporary password that they would need to change upon first log in. That's the intent anyway

Thanks for you help and I look forward to hearing what you find out (or come up with as a fix).
Best regards,
Christopher
P.S. Should I open a ticket for this? Or do you have that covered? Thanks again!


Automated fix message
This issue has now been filed on the tracker as issue #4204, with a fix.cwdean said
Hello everyone,
I'm having some real difficulties figuring out how to get Welcome Emails to work. I have newletters enabled, so the functionality for tempcode (or parameters) should work. In particular, I would like to have the Welcome Email personalized so that the name (or firstname) will appear.
For example, I would like —
Dear {name},
to have the {name} parameter be changed to the name of the person receiving the email. This is not happening. It appears just as entered. I would also like to have parameters for {username} and {password} filled in properly as well. But again, no parameters are getting filled in…so I'm assuming they are not getting passed?
Another problem I'm noticing is that when I preview the body of the email, I am getting two error messages:
A language string is missing: NEWSLETTER_UNSUBSCRIBE_NEWSLETTER
A language string is missing: NEWSLETTER_UNSUBSCRIBE_MEMBER
I looked inside the newsletter.ini and these two language strings do exist, so I have no idea why I'm getting these messages. But they are messing up the bottom of the emails where the user should be able to opt out of the subscription. Any ideas why this is happening?
When previewing the Welcome email I am receiving the emails via SMTP but without the parameters variables being replaced.
Thanks in advance for any assistance you can offer. Much appreciated.
Best,
Christopher


Whilst I was fixing all this I part-solved your issue needing to have passwords in there.
You can now do {m_pass_hash_salted}.
It will just give you the hash, but I'll discuss further in your other topic (Help with Account approval email - Composr).
Become a fan of Composr on Facebook or add me as a friend. Add me on on Mastodon. Follow me on Minds (where I am most active). Support me on Patreon
- If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
- If so, please let others know about Composr whenever you see the opportunity or support me on Patreon.
- If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying Composr on fun personal projects.
- If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.


I've downloaded the hotfix and will check it out later today.


An error has occurred
A source code file is missing/corrupt/incompatible: cns_welcome_emails... "include() [<a href='http://php.net/manual/en/function.include.php'>function.include.php</a>]: Failed opening 'sources/cns_welcome_emails.php' for inclusion (include_path='.:/usr/local/php73/pear')" (sources/cns_welcome_emails.php or an overridden equivalent to this path) (version: 10.0.30, PHP version: 7.3.16, URL: /data/preview.php?page=admin_cns_welcome_emails&type=_edit)
Looks like code is looking for cns_welcome_emails.php in the sources folder. I don't see any such file in that folder (not prior to updating or afterward. The fix wants that file to be located in sources/hooks/systems/preview.
Any I overlooking something or done something incorrectly? As far as I can tell, I've placed the files in the correct directories and ensured that permissions are still set properly (0644).
Thoughts?


It's here and I'll update the fix.
https://gitlab.com/composr-foundation/composr/-/raw/master/sources/cns_welcome_emails.php
Become a fan of Composr on Facebook or add me as a friend. Add me on on Mastodon. Follow me on Minds (where I am most active). Support me on Patreon
- If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
- If so, please let others know about Composr whenever you see the opportunity or support me on Patreon.
- If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying Composr on fun personal projects.
- If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.


Ah, sorry, it must have not made it into the hot-fix.
It's here and I'll update the fix.
https://gitlab.com/composr-foundation/composr/-/raw/master/sources/cns_welcome_emails.php
That fixed it

Quick question: the fix now looks like this, which is fine:
You are receiving this newsletter because you have a member account set to “Receive newsletters and other site updates”. You can change your settings at: https://torhoa.org/site/index.php?page=members&type=view#tab__edit
I don't see that option on Edit/Settings tab. And since this is a Welcome email, the term 'newsletter' may be confusing. I don't think it's that big a deal, but the link to change your settings probably needs to be clear. Is that link correct? because I'm not seeing "Receive newsletters and other site updates" there.


Automated fix message
This issue has now been filed on the tracker as issue #4210, with a fix.cwdean said
Ah, sorry, it must have not made it into the hot-fix.
It's here and I'll update the fix.
https://gitlab.com/composr-foundation/composr/-/raw/master/sources/cns_welcome_emails.php
That fixed it
Quick question: the fix now looks like this, which is fine:
You are receiving this newsletter because you have a member account set to “Receive newsletters and other site updates”. You can change your settings at: https://torhoa.org/site/index.php?page=members&type=view#tab__edit
I don't see that option on Edit/Settings tab. And since this is a Welcome email, the term 'newsletter' may be confusing. I don't think it's that big a deal, but the link to change your settings probably needs to be clear. Is that link correct? because I'm not seeing "Receive newsletters and other site updates" there.


If the only correction made was to add the "sources/cns_welcome_emails.php" file then I was able to download that file from gitlab and apply. That definitely fixed the Error I was getting.
However, I am now not receiving any Welcome emails

Does the Welcome email require the new account to be pre-validated in order to be sent? Trying to figure out how I got it to work the first time but not the second. Any thoughts or suggestions?
Thanks for all your help!


Automated fix message
This issue has now been filed on the tracker as issue #4211, with a fix.cwdean said
Thank-you!
If the only correction made was to add the "sources/cns_welcome_emails.php" file then I was able to download that file from gitlab and apply. That definitely fixed the Error I was getting.
However, I am now not receiving any Welcome emails. This may not be related to the apply fix but it is definitely something I am now experiencing. It worked the first time which is how I was able to report the original language string errors, but after creating a second account (with the latest fixes) I did not receive the Welcome email. I did receive the Validation email after validating, however.
Does the Welcome email require the new account to be pre-validated in order to be sent? Trying to figure out how I got it to work the first time but not the second. Any thoughts or suggestions?
Thanks for all your help!


I've implemented above a special case whereby immediate welcome e-mails will now ignore validation, as obviously staff can't handle validation in a zero time span.
Otherwise, the behaviour is now documented.
That said…
We have been discussing implementing the feature to simply send out an e-mail when you add the member, which hopefully bypasses any need for these kinds of welcome e-mail or validation e-mail workarounds.
Become a fan of Composr on Facebook or add me as a friend. Add me on on Mastodon. Follow me on Minds (where I am most active). Support me on Patreon
- If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
- If so, please let others know about Composr whenever you see the opportunity or support me on Patreon.
- If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying Composr on fun personal projects.
- If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.


Chris Graham said
Your suspicion was correct, it does respect validation.
I've implemented above a special case whereby immediate welcome e-mails will now ignore validation, as obviously staff can't handle validation in a zero time span.
Otherwise, the behaviour is now documented.
That said…
We have been discussing implementing the feature to simply send out an e-mail when you add the member, which hopefully bypasses any need for these kinds of welcome e-mail or validation e-mail workarounds.
From “Post #6,613”, 26th April 2020, 5:36 am
Thanks for confirming my suspicion. I'm glad you implemented a special case as I did find that behavior unusual, because as you state, 'staff can't handle validation in a zero time span'. is that 'fix' available for download?
Yes, we are definitely continuing to work out the details for sending an email when you add a member (see my latest response).


Become a fan of Composr on Facebook or add me as a friend. Add me on on Mastodon. Follow me on Minds (where I am most active). Support me on Patreon
- If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
- If so, please let others know about Composr whenever you see the opportunity or support me on Patreon.
- If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying Composr on fun personal projects.
- If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.


Chris Graham said
The link to the fix was posted above (0004211: Welcome e-mails should go out if set to immediate even if validation not happened - Composr CMS feature tracker).
From “Post #6,619”, 28th April 2020, 9:08 pm
Perfect. Thanks Chris. I'll check this out shortly.