Newsletter Questions

Post

Posted
Rating:
#3268 (In Topic #608)
Joe
Avatar
Standard member
Joe is in the usergroup ‘Honoured member’

Just a few!

  • Newsletter Confirmations
    • Is there a way to disable "confirmation" of newsletter signups? I still want to send an email, perhaps welcoming them or confirming they've been added, but without the requirement to "click-to-confirm".

  • Newsletter Signup Block vs :newsletter Signup Page
    There seems to be a slight difference between the two:
    • If a member signs up through the block, I'm able to customize the confirmation email by uploading and referencing a file to the block's params (if this file doesn't exist or I don't specify one, the default confirmation email is sent)
    • If they signup through the :newsletter module/page, they are sent a similar confirmation email but with a different layout. This email contains additional formatting. Unlike the confirmation email sent by the block (which is basic, no comcode), this confirmation email is surrounded in what looks like a box tag.
    • So my question here is - can I customize the email that the :newsletter module sends (similar to how you can with the newsletter block by creating a custom file)?
    • Also, is this the best way to customize these emails? i.e. as opposed to modifying a mail template?

  • Mail Template
    I wanted to get into a little more detail on that mail template I just mentioned.
    • When 'sending fresh newsletter issue', there is a setting option at the bottom that asks which template the email should use. Even though there is only one to choose from (the 'MAIL' template), where do I find this template to modify it? I've searched all the templates relevant to the newsletter module, and none seem to really define a layout for the actual email the system sends out.
    • The description for this setting states: "Which template to use to send the newsletter. This defines the overall appearance (logo, colors, etc). The default for all newsletter e-mails is 'MAIL'."

  • Welcome Emails
    This one may involve two bugs, if so I can post in the appropriate forum if necessary.
    • Under Tools -> Members -> Welcome emails:
      • When choosing 'Add new welcome email', the Send time option is defined as "The number of hours after each member's joining before sending the e-mail to them". If I put 0 here, does it send the email instantly?
    • Possible bug #1: There may be an issue isolated to my specific installation, but whenever I create a welcome email, choosing 'Edit welcome email' on the previous page yields no results; as if it's not saving to the database.
    • Possible bug #2: The 'there is a tutorial that covers this feature' link directs me to a tutorial on the member system. Its irrelevant in regards to welcome emails, hence why I'm inquiring about the 'Send time' option

Sorry for the long post. Just had a few questions! :)

Update: I have confirmed the system has saved the welcome email I create. It does indeed send it out, but I'm unable to edit it as it doesn't show on the list of welcome emails I've created. I also answered my own question about the Send time option; '0' does send it out within a few minutes.

Last edit: by Joe

Online now: No Back to the top

Post

Posted
Rating:
#3271
Avatar
Site director
Chris Graham is in the usergroup ‘Administrators’
Is there a way to disable "confirmation" of newsletter signups? I still want to send an email, perhaps welcoming them or confirming they've been added, but without the requirement to "click-to-confirm".

Yes and no.

If you use the 'path' parameter on the main_newsletter_signup block (points to a Comcode-containing text file which will be sent out when people signup with that block) no confirm will happen.
So that's what you want.
You cannot do it for signups directly through the module.
Make sure the path you use is relative to the base directory (install directory).

If a member signs up through the block, I'm able to customize the confirmation email by uploading and referencing a file to the block's params (if this file doesn't exist or I don't specify one, the default confirmation email is sent)

Yes (same thing I mentioned above).

If they signup through the :newsletter module/page, they are sent a similar confirmation email but with a different layout. This email contains additional formatting. Unlike the confirmation email sent by the block (which is basic, no comcode), this confirmation email is surrounded in what looks like a box tag.

I'm not sure why there'd be a difference from analysing the code just now. In both cases it should be sending the NEWSLETTER_SIGNUP_TEXT language string, which contains Comcode for the e-mail.
The default mail template does have a box around stuff, wrapping the e-mail content.

So my question here is - can I customize the email that the :newsletter module sends (similar to how you can with the newsletter block by creating a custom file)?

Yes, change NEWSLETTER_SIGNUP_TEXT.

Also, is this the best way to customize these emails? i.e. as opposed to modifying a mail template?

Most e-mails come out of language strings, and it's functionally equivalent to editing a template.

When 'sending fresh newsletter issue', there is a setting option at the bottom that asks which template the email should use. Even though there is only one to choose from (the 'MAIL' template), where do I find this template to modify it? I've searched all the templates relevant to the newsletter module, and none seem to really define a layout for the actual email the system sends out.

You need to manually create a template that matches the filename pattern MAIL*.tpl.

If I put 0 here, does it send the email instantly?

If CRON is set up, it's the next run of CRON.

Possible bug #1: There may be an issue isolated to my specific installation, but whenever I create a welcome email, choosing 'Edit welcome email' on the previous page yields no results; as if it's not saving to the database.

I can see an issue with multi-site-networks. It's saving onto site-db and reading from forum-db. It's meant to do all welcome emails from site-db, as they are site-specific (even though it is a part of Conversr, which is a little confusing).

Here's a patch….

Code (Diff)

diff --git a/sources/crud_module.php b/sources/crud_module.php
index 084d32427..55e854661 100644
--- a/sources/crud_module.php
+++ b/sources/crud_module.php
@@ -1118,7 +1118,7 @@ abstract class Standard_crud_module
         }
         $table_raw = (is_null($this->table) ? $this->module_type : $this->table);
         $table = $table_raw . ' r';
-        $db = ((substr($table, 0, 2) == 'f_') && (!$force_site_db) && (get_forum_type() != 'none')) ? $GLOBALS['FORUM_DB'] : $GLOBALS['SITE_DB'];
+        $db = ((substr($table, 0, 2) == 'f_') && ($table != 'f_welcome_emails r') && (!$force_site_db) && (get_forum_type() != 'none')) ? $GLOBALS['FORUM_DB'] : $GLOBALS['SITE_DB'];
         if (($orderer_is_multi_lang) && (preg_replace('# (ASC|DESC)$#', '', $orderer) == $select_field)) {
             $_orderer = $GLOBALS['SITE_DB']->translate_field_ref(preg_replace('# (ASC|DESC)$#', '', $orderer));
             if (substr($orderer, -5) == ' DESC') {
 

Let me know if you need some help there like an actual new file.

Possible bug #2: The 'there is a tutorial that covers this feature' link directs me to a tutorial on the member system. Its irrelevant in regards to welcome emails, hence why I'm inquiring about the 'Send time' option

Ah, yes. It's on tut_adv_members not tut_members. Fixed.

Sorry for the long post. Just had a few questions! :)

They were very good questions.

Last edit: by Chris Graham



Become a fan of Composr on Facebook or add me as a friend. Add me on on Twitter. Follow me on Minds (where I am most active). Support me on Patreon

Was I helpful?
  • 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.
Online now: No Back to the top

Post

Posted
Rating:
#3272
Avatar
Site director
Chris Graham is in the usergroup ‘Administrators’
Updated our docs / field descriptions / code so this is all more obvious for future users :).

Misc newsletter fixes based on feedback · ocproducts/composr@4ef7912 · GitHub


Become a fan of Composr on Facebook or add me as a friend. Add me on on Twitter. Follow me on Minds (where I am most active). Support me on Patreon

Was I helpful?
  • 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.
Online now: No Back to the top

Post

Posted
Rating:
#3273
Avatar
Site staff
enelson is in the usergroup ‘Super-moderators’

Chris Graham said

If CRON is set up, it's the next run of CRON.

So if CRON isn't set up, nothing happens?

Chris Graham said

If CRON is set up, it's the next run of CRON.

So if CRON isn't set up, nothing happens?
Online now: No Back to the top

Post

Posted
Rating:
#3274
Avatar
Site director
Chris Graham is in the usergroup ‘Administrators’

enelson said

Chris Graham said

If CRON is set up, it's the next run of CRON.

So if CRON isn't set up, nothing happens?

Yeah that's correct, I wasn't clear there. Welcome emails are only sent from CRON.

enelson said

Chris Graham said

If CRON is set up, it's the next run of CRON.

So if CRON isn't set up, nothing happens?

Yeah that's correct, I wasn't clear there. Welcome emails are only sent from CRON.


Become a fan of Composr on Facebook or add me as a friend. Add me on on Twitter. Follow me on Minds (where I am most active). Support me on Patreon

Was I helpful?
  • 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.
Online now: No Back to the top

Post

Posted
Rating:
#3276
Joe
Avatar
Standard member
Joe is in the usergroup ‘Honoured member’
Hey Chris,

Thanks for the reply.

If I create a custom email file and reference it to the newsletter block, you are correct in that it doesn't specifically ask the user to confirm (as it wouldn't if I didn't add any reference to needing to confirm in my custom file), but it seems the module doesn't add the user into the mailing list unless they confirm. So ultimately they are required to confirm regardless of whether I specify a path to a custom email or not. If they don't confirm, they don't get added into the list. Is this what you mean by yes and no?  :lol:

Regarding the email "box" formatting - it seems there is only 2 times the email is sent with that specific formatting. When a user signs up though the :newsletter module, and when a new user joins and I create a custom welcome email. If I create a custom newsletter email (and reference it in the newsletter block (path param)) or send out a fresh newsletter, there doesn't seem to be any formatting to the email.


I tried your fix in crud_module.php, but this did not make the welcome email entries appear when I click 'edit welcome email' under the Welcome Emails feature. I wasn't sure if I was supposed to replace the file in /sources/ or add it to /sources_custom/ so I did both and neither seem to have an impact.
Online now: No Back to the top

Post

Posted
Rating:
#3282
Joe
Avatar
Standard member
Joe is in the usergroup ‘Honoured member’
Chris, I just got an error when trying to edit a comcode page. I was editing pages for a while and suddenly it just came up. Maybe the caches catching up? Anyhow, here's the error that your fix gave me:

Fatal error: Cannot instantiate abstract class non_overridden__Standard_crud_module in /public_html/sources/zones.php on line 1692
Critical error – bailing out
This is an error that has been elevated to critical error status because it occurred during the primary error mechanism reporting system itself (possibly due to it occurring within the standard output framework). It may be masking a secondary error that occurred before this, but was never output - if so, it is likely strongly related to this one, thus fixing this will fix the other.
PHP ERROR [1] Cannot instantiate abstract class non_overridden__Standard_crud_module in sources/zones.php on line 1692
Online now: No Back to the top

Post

Posted
Rating:
#3325
Avatar
Site director
Chris Graham is in the usergroup ‘Administrators’
Hi,

Sorry for the delay, I was a bit busy then got sick for a few days.

If I create a custom email file and reference it to the newsletter block, you are correct in that it doesn't specifically ask the user to confirm (as it wouldn't if I didn't add any reference to needing to confirm in my custom file), but it seems the module doesn't add the user into the mailing list unless they confirm. So ultimately they are required to confirm regardless of whether I specify a path to a custom email or not. If they don't confirm, they don't get added into the list. Is this what you mean by yes and no?  :lol:

I just tested and it worked as described, with 1 caveat – the message showed said there was a confirmation to be done, even when there was not.
I think when this was originally implemented it was undocumented functionality for people doing heavy customisation, so I must have forgotten to make that message auto-adjustable. That will be corrected in the next patch release. You can workaround just by editing the SUCCESS_NEWSLETTER_AUTO language string (in newsletter language file) to whatever you wish, which you probably would want to do anyway.

There is another caveat, make sure you're not running 2 instances of the block with different block parameters, e.g. 1 in a panel and 1 on the main page. I made that mistake when testing.

Here is the Comcode I used:

Code

[block path="uploads/website_specific/test.txt"]main_newsletter_signup[/block]
I had manually created a uploads/website_specific/test.txt file.

Regarding the email "box" formatting - it seems there is only 2 times the email is sent with that specific formatting. When a user signs up though the :newsletter module, and when a new user joins and I create a custom welcome email. If I create a custom newsletter email (and reference it in the newsletter block (path param)) or send out a fresh newsletter, there doesn't seem to be any formatting to the email.

I still can't explain that I'm afraid.
I took a screenshot from my test.

I wonder if maybe sometimes you're viewing the plain text versions, or if you have any theme that is changing the MAIL.tpl template and it's using different themes in different contexts somehow.

14 views (269 KB)
I tried your fix in crud_module.php, but this did not make the welcome email entries appear when I click 'edit welcome email' under the Welcome Emails feature. I wasn't sure if I was supposed to replace the file in /sources/ or add it to /sources_custom/ so I did both and neither seem to have an impact.

I'll do a test soon.

Chris, I just got an error when trying to edit a comcode page. I was editing pages for a while and suddenly it just came up. Maybe the caches catching up? Anyhow, here's the error that your fix gave me:

Inability to override sources/crud_module.php on some PHP versions was fixed in the last patch release.
However if I provide a fix almost always it's best to just overwrite the original files (keep backups though). The fixes will come through in the next patch release anyway.


Become a fan of Composr on Facebook or add me as a friend. Add me on on Twitter. Follow me on Minds (where I am most active). Support me on Patreon

Was I helpful?
  • 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.
Online now: No Back to the top

Post

Posted
Rating:
#3328
Avatar
Site director
Chris Graham is in the usergroup ‘Administrators’
My crud_module.php change was indeed not working, I edited my post to fix it.


Become a fan of Composr on Facebook or add me as a friend. Add me on on Twitter. Follow me on Minds (where I am most active). Support me on Patreon

Was I helpful?
  • 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.
Online now: No Back to the top
1 guest and 0 members have just viewed this.

Statistics

Users online:

gabriel58, John Connor, ManojSree, mytracker

Forum statistics:
  • 1,070 topics, 5,160 posts, 6,010 members
  • Our newest member is Kathraal
Birthdays:
Back to Top