Automatic Newsletter for SMF2

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

Previous topic - Next topic

HoverClub

Quote from: luuuciano on December 28, 2012, 09:15:06 PM
You mean notification on new replies/posts? members using that option will receive an email every new thing they had...
But using a daily newsletter option they will receive just one daily digest, about new topics, etc...
Or... people is a bit silly, and do not set ups notifications... with daily digests they have another option to use... they may use the one they prefer
They can select daily or weekly digests using the SMF notification system.
QuoteBTW, one question... subscribed users can change they settings somewhere? (weekly, fortnightly, etc)
No settings are needed as it's very easy just to unsubscribe and re-subscribe again with different settings.
QuoteBTW2, It could be implemented an option to include a random news fade item, instead always the latest one?
(we have quotes in there)
Then it wouldn't be new news but could be old or duplicate news that they get. - not what would be expected from a newsletter IMO.
QuoteBTW3, where to touch to change the topic image, to the user avatar? it would be nicer that way
BTW4, where to touch to send only new topics, instead new messages (replies on topics) + new topics?
See posts below in this thread - it would need a change to the SQL query.

Thanks for the Spanish translation!

luuuciano

wow... I have no idea why this happened, but I have instaled this mod 3 or 4 days ago...
Then the mysql server started to go down like 4 to 6 times a day........ I was just restarting it (mysqld)
Then I uninstalled it... all normal, all ok...
No me agradan los foros que no te dejan borrar TU PROPIO usuario, como por ejemplo smfsimple.com.
E incluso te mandan emails no solicitados, de los cuales, quizá, no puedas escapar porque NO te dejan posibilidad a deshabilitarlos (a menos que NO te tengan en su lista negra).

ro-lkw

Doesn't work on my forum.I have theme WHITEBOX.

Can help me someone ?

HoverClub

Quote from: ro-lkw on January 08, 2013, 12:12:22 PM
Doesn't work on my forum.I have theme WHITEBOX.

Can help me someone ?
Not unless you can provide a bit more information than "it doesn't work"  ::).  Exactly what doesn't work?  Did it install properly?  Does it work with the standard Curve theme?  Are the configuration options available? Does the sign-up info appear on the forum page?  Etc, etc.

HoverClub

Quote from: luuuciano on January 06, 2013, 01:04:03 AM
wow... I have no idea why this happened, but I have instaled this mod 3 or 4 days ago...
Then the mysql server started to go down like 4 to 6 times a day........ I was just restarting it (mysqld)
Then I uninstalled it... all normal, all ok...
The mod only makes one very simple SQL query for each board index page load - if that's causing your SQL server to choke then you've got other more serious issues I'm afraid  :(.

scvoyager

I downloaded this mod yesterday and so far it is great. I have reworked much of it to fit my forums needs and the first newsletter turned out almost perfect showing everything as expected plus the latest youtube videos and photos. I did make a change so members can pick daily, weekly and monthly. I did this for testing reasons and also members may like to get the latest daily changes to the forum.

The one thing I can't get working completely is having the form show up on the simple portal page. I have had a lot of parse errors and currently have all the buttons showing but no text yet.

This is kind of out of my league and could use some help on how to make a php block for this mod.

HoverClub

You don't say which portal you are using - this is what I've used with EzPortal:
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 {db_prefix}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" />';

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>';
}

scvoyager

I put the portal (simple portal) in the second paragraph but I have found most php blocks interchange between most of the portals. Your php block works perfect and only had to make a few changes that had nothing to do with your great work.

Thanks much.

Gryzor

Can you help? I tried upgrading to today's version, but I get this error when I try to access the settings:

QuoteTable 'wikiforum.smf_gallery_cat' doesn't exist
File: /path...forum/Sources/ManageSettings.php
Line: 2658

Note: It appears that your database may require an upgrade. Your forum's files are currently at version SMF 2.0.3, while your database is at version 2.0.1. The above error might possibly go away if you execute the latest version of upgrade.php.

SELECT id_cat, title FROM smf_gallery_cat ORDER BY roworder ASC

needless to say, it worked fine before and I haven't had that message before... my 2.03 upgrade worked fine and upgrade.php has been deleted as usually, so not sure that's the problem. Any feedback?

Thanks!

HoverClub

It's a bug  :-[ -I'll upload an update shortly.  Thanks for the testing  ;)

Gryzor

Phew. For a few minutes I got panicked, because I had just done some major tuning on my server and I thought I broke something - been looking in my db backups :D

Thanks, can wait :)

Gryzor


assemblytube

Installed Automatic Newsletter version 121 and it is causing me problems.
Previously had version 114 and it was working well.
I uninstalled 114 and installed 121. The install seemed to go OK and I can see a sample Newsletter with the new features.
However, I now get this chunk of text at the top of my forum pages:

SendNews(); return true; } function scheduled_send_email_campaign() { global $smcFunc, $sourcedir; global $sourcedir; require $sourcedir . '/NewsPro2.php'; // Loop though all the pending campaigns $curTime = time(); $result = $smcFunc['db_query']('', "SELECT ID_CAMPAIGN FROM {db_prefix}newspro_campaigns WHERE removed = 0 AND status = 0 AND scheduledate < $curTime"); while ($row = $smcFunc['db_fetch_assoc']($result)) { SendCampaign($row['ID_CAMPAIGN']); } // Return for the log... return true; } ?>


And in additon this has affected the display of items on my SimplePortal front page.

I uninstalled 121 and I still have the chunk of text showing at the top of my forum pages.

Can you advise me on where I might look to fix this please.
Thanks for your help.

HoverClub

Its the end of the Newsletter mod (up to the return true;) followed by another mod's code.  Both bits of code should be in Sources/ScheduledTasks.php - how they got to the top of the forum page I've no idea!  Might be a good idea to do a full code restore?

assemblytube

Thanks for the advice.
Site now working properly.
I believe I had a conflict between this Newsletter mod and another Newsletter mod I have.
Thanks.

b0tze

Thank you very much for this mod!

I had the preview/compression issue as well, but figured it out by reading through this thread ;-)
Now I am excited to see the actual mail, but I guess I have to wait 7 days now... How about a "send preview to webmaster" button? Might have the advantage to be able to check if it's working, in case there are other issues. Or a welcome-newsletter after signing up... Just ideas, I love it already :-D

Thanks again!
b0tze

Sudhakar Arjunan

Hi Hoverclub,

Is this version has a update for the preview/compression issues . Because as said in 6th page by other user. When i enable compression, our 140 users were getting email. But server is overloading and i have got my MySQL freezed several times a day.

So over month the mod is working and not sending to anyone.Got 140 subscribes as shown in admin page.

If this version has the fix for preview / compression issues. Then i will use it . Kindly advice.
Working on New Mods & Themes for SMF... Will update soon... My Blog page
My Smf forum : Discuss ITAcumens :: My SMF Forum

HoverClub

The HTML part of the newletter has been tidied up but there is no fix for the compression issue as that's handled by SMF. 

Enabling compression increases server load - disabling it decreases load (either way it has no effect on MySQL load!).   Compression reduces bandwidth but that's all - if your server is already compressing the data then enabling it in SMF just wastes server resources.

b0tze
I don't understand how you know you have a compression issue if you haven't received any newsletters yet?  The admin preview lets you check the newsletter looks OK - provided your SMF email/scheduled tasks settings work with other forum emails then the newsletter will get sent.

b0tze

no problems, just saying i had the compression issues (preview-error) until i disabled the compression output at server settings and now it works, so now i'm looking forward to receiving the first newsletter-mail :-)

b0tze

Now I do have problems, my first newsletter was due yesterday but did not go out. I have following errors in the log:

8: Undefined variable: videos
2: Invalid argument supplied for foreach()

each error 3 times. I have set number of videos to 0 (don't need any). The preview seems to work, but only shows this:

Forum [as a link to the forum]
Latest News:
[content: the latest news i entered]
Forumstatistiken
[statistical content]

There is no content about any threads or posts (from the last days).

Would be great to get it working, thanks a lot for any advice!

cheers, b0tze

Advertisement: