Automatic Newsletter for SMF2

Started by HoverClub, March 31, 2012, 12:54:12 PM

Previous topic - Next topic

HoverClub

The videos error is a bug and will be fixed at the next update.

What settings do you have for the mod (are you sure you haven't disallowed ALL boards that may have new posts)?

b0tze

ok, good to know and thanks in advanced!

a screenshot of my settings is attached, I excluded 2 out of many more, so there should be enough content left.

HoverClub

The mod looks for the last posts anywhere on the forum - the only exceptions are the recycle board (if you have one) and any excluded boards you've selected in the mod settings.  The posts must be also be approved (or are auto-approved).  It's a simple SQL query and I can't see how it can fail to find any posts unless there aren't any  ???

If you can give me access (PM) to your test forum I can take a look.

b0tze

I am such an idiot.
For everyone else reading this thread: I understood the opposite of the expanation of the "use guest permission". Reading more careful would have helped...

Thanks again, HoverClub, for the help and this great mod!
b0tze

error_2

Hi,

I have installed this mod to my site. It introduced 15 errors on hxxp:validator.w3.org/check?uri=yoursitehere.com [nonactive]
Can you update your mod to complain with w3 validator?

Thanks!

gpwizard

Hi,

I've installed the mod and get a successful preview. When I cut and paste the block code provided into a PHP block in Simple Portal I get a syntax error. On checking the code I get  - syntax error, unexpected T_CONSTANT_ENCAPSED_STRING on line 13

Can you help with this please.

Cheers

HoverClub

Quote from: gpwizard on March 11, 2013, 07:09:02 PM
On checking the code I get  - syntax error, unexpected T_CONSTANT_ENCAPSED_STRING on line 13
... in which file?

gpwizard

In the portal_block.php file provided. The problem here maybe obvious but its not to me. Any help is appreciated.

Quote<?php
   global $modSettings, $txt, $scripturl, $context;
   
   // make sure newletter is installed and enabled
   if (!empty($modSettings['newsltr_news']) OR !empty($modSettings['newsltr_events']) OR !empty($modSettings['newsltr_topic_count']))
   {
      $context['user']['newsltr'] = array('next_ltr_date'=>'', 'period'=>'', 'email'=>'',);
      if (!$context['user']['is_guest'])
      {
         global $smcFunc;
         $result = $smcFunc['db_query']('', '
            SELECT email, next_ltr_date, period
               FROM smf_hcb_newsletter
            WHERE email = '' . $context['user']['email'] . ''
               LIMIT 1'
         );

         if ($row = $smcFunc['db_fetch_assoc']($result))
            $context['user']['newsltr'] = $row;
         $smcFunc['db_free_result']($result);
      }
   
      echo '
   <div class="smalltext">
      <form action="',$scripturl,'?action=NewsSubscribe" method="post" accept-charset="',$context['character_set'],'" name="newsSubscriber">
         <input type="hidden" name="sc" value="', $context['session_id'], '" />
         <input type="hidden" name="lastaction" value="forum" />' . $context['forum_name'] . ' ' . $txt['newsubscribe_mod_title'];
      
      if ($context['user']['is_guest'])
         echo $txt['newsubscribe_mod_email'] . '<input type="text" clasa="input_text" maxlength="255" size="25" value="' . $context['user']['newsltr']['email'] . '" name="email" />';
      else
         echo '
            <input type="hidden" name="email" value="', $context['user']['email'], '" />';
      if ($context['user']['is_guest'] OR empty($context['user']['newsltr']['email']))
         echo '
         <input type="submit" class="button_submit" name="subscribe" value="' . $txt['newsubscribe_mod_subscribe'] .'"/>
         <br /><Input type="radio" name ="period" value="7"' . (($context['user']['newsltr']['period'] == 7) ? ' checked' :'')  . '>' .
         $txt['newsubscribe_mod_week'] . '
         <br /><Input type="radio" name ="period" value="14"' . (($context['user']['newsltr']['period'] == 14) ? ' checked' :'')  . '>' .
         $txt['newsubscribe_mod_fort'] . '
         <br /><Input type="radio" name ="period" value="30"' . ((empty($context['user']['newsltr']['period']) OR $context['user']['newsltr']['period'] == 30) ? ' checked' : '')  . '>' . $txt['newsubscribe_mod_month'];
      if ($context['user']['is_guest'] OR !empty($context['user']['newsltr']['email']))
         echo ($context['user']['is_guest'] ? '<br />' : $txt['newsubscribe_mod_next'] . date(' j F', $context['user']['newsltr']['next_ltr_date'])) . '<input type="submit" class="button_submit" name="unsubscribe"  value="' . $txt['newsubscribe_mod_unsubscribe'] .'"/>';
   echo '
      </form>
   </div>';
   }
?>

HoverClub

change
WHERE email = '' . $context['user']['email'] . ''
to
QuoteWHERE email = \'' . $context['user']['email'] . '\'

shady18n

Hi, is it possible to autosubscribe all members to the newsletter (and then let them unsubscribe, if they wish)? i.e. opt-out rather than opt-in?

Sudhakar Arjunan

Quote from: shady18n on March 27, 2013, 08:43:31 PM
Hi, is it possible to autosubscribe all members to the newsletter (and then let them unsubscribe, if they wish)? i.e. opt-out rather than opt-in?

Good idea, think about the mails sent to spam if you have more than 500 emails in your site. If users have more than 40,000 users like us. Spam will be a bigger concern. And you will daily receive thousands and thousands of failure notice in your email if this option is done.

But idea sounds good.  8)
Working on New Mods & Themes for SMF... Will update soon... My Blog page
My Smf forum : Discuss ITAcumens :: My SMF Forum

shady18n

Quote from: A.SK on March 28, 2013, 01:11:28 PM

Good idea, think about the mails sent to spam if you have more than 500 emails in your site. If users have more than 40,000 users like us. Spam will be a bigger concern. And you will daily receive thousands and thousands of failure notice in your email if this option is done.

But idea sounds good.  8)

It might not be appropriate to your site, but in my case, we have 500 invitation-only members. Some subscribed in the early days of the forum and we'd like to entice them back by showing them what they are missing.

HoverClub

This has been discussed previously (see HERE).  If you want to send a single reminder to all members then you can use the SMF Admin News & Newsletter function to do that.

shady18n

Quote from: HoverClub on April 01, 2013, 07:18:19 AM
This has been discussed previously (see HERE).  If you want to send a single reminder to all members then you can use the SMF Admin News & Newsletter function to do that.

Yes, but that doesn't send a sample of this newsletter, does it? My issue is similar to that in the referenced post - I'd like to bring back in dormant members. I don't mind that being a one off send of a sample newsletter via the SMF newsletter function, but would like to be able to send the content of the newsletter mod. I'm not too worried about auto-subscribing people (I'd prefer to have it as an option, I can understand why others don't want it on their forums).

HoverClub

Quote from: shady18n on April 02, 2013, 06:54:22 AM
Yes, but that doesn't send a sample of this newsletter, does it?
Preview the newsletter sample - > Right-click: View Page Source -> copy all -> paste into Admin newsletter and tick the "Send in HTML format..."

Sudhakar Arjunan

Quote from: HoverClub on April 02, 2013, 09:15:20 AM
Quote from: shady18n on April 02, 2013, 06:54:22 AM
Yes, but that doesn't send a sample of this newsletter, does it?
Preview the newsletter sample - > Right-click: View Page Source -> copy all -> paste into Admin newsletter and tick the "Send in HTML format..."

Good but, honestly he would have not expected this kind of response from you. Yes it works but still we need in a mod format and not a manual process as shady18n said.
Working on New Mods & Themes for SMF... Will update soon... My Blog page
My Smf forum : Discuss ITAcumens :: My SMF Forum

HoverClub

Quote from: A.SK on April 02, 2013, 05:28:59 PM
Good but, honestly he would have not expected this kind of response from you. Yes it works but still we need in a mod format and not a manual process as shady18n said.
Quote from: chady18nI don't mind that being a one off send of a sample newsletter via the SMF newsletter function, but would like to be able to send the content of the newsletter mod. I'm not too worried about auto-subscribing people...
It's simply not worth the considerable effort required to develop and test mod code for something that takes 4 seconds to do and is only occasionally used - unless you want to volunteer to do it?

shady18n

Sorry not to have responded earlier (must set notify on thread).

Actually, HoverClub's response is fine, that is basically what I need, and I wasn't aware of the option quoted. It would be great if it were part of the mod, but I don't mind running it manually.

Many thanks.

error_2

I have removed your mod because you are ignoring my error report.

QuoteHi,

I have installed this mod to my site. It introduced 15 errors on hxxp:validator.w3.org/check?uri=yoursitehere.com [nonactive]
Can you update your mod to complain with w3 validator?

Thanks!

Arantor

Considering that you never actually bothered to say what the errors were... and the fact that they're probably caused by a combination of this mod (which doesn't seem to cause errors on the default theme) and your custom theme...

That, and the fact that I doubt the ignoring was intentional. You know people do occasionally miss things. Especially when it's someone who made something and was nice enough to share. You're *not required* to use it, just as HoverClub is *not required* to keep it up to date or anything.

Advertisement: