blogの新着記事をメール配信するプラグインです。
cronを利用できないサーバの場合、WebCronやpseudo-cronなど。
本家版ではメールに日本語を含むと送信できないようです。日本語対応情報
| General Plugin info | |
|---|---|
| 作者: | TeRanEX |
| 最新のバージョン: | 1.2 (2005-8-26) |
| 入手先: | Nucleus Plugin: NP_MyNewsletter |
| ソース: | |
| 動作サンプル: | |
| フォーラム参照先: | NP_MyNewsletter: send completely customizable newsletters! |
The plugin has quite a few options:
With this option you can choose a translation for the plugin. Please see Translations for more info. Deafult value: default
This is like a password. When you want to send the newsletter you’ll have to provide the right checkword. This is to prevent visitors and bots from accidentally sending the newsletter. After you install the plugin you should change this checkword, so that it is not the default value! Default value: MyNewsletter
This is the encoding that will be written into the e-mail header (might be useful..) Default value: UTF-8
Send your mails as:
Using this option you can choose to send HTML-mails (using content-type text/html) or plaintext-mails using text/plain. If you choose to send plaintext-mails you should of course not use html-tags in your newsletter-skin, and the plugin will try to strip all html-tags before sending the mails. Default value: HTML
When sending a newsletter the plugin can send an individual, personalized mail to every user or you can choose to send only one e-mail (in this case the BCC-field is used). Individual mails are nicer (because they can be personalized), but need more resources to send (more server load) Default value: Yes
The subject of your newsletter, by example “Daily update of Tom’s blog” Default value: Daily update of my blog
The e-mail address that is used as the sender of your newsletter. This address is also used to send notifications when sombody subscribes/unsubscribes, so if you want to use that option you should change this e-mail address to be a valid one. Default value: noreply@example.com
The name that is used as the sender of your newsletter Default value: My blog
If this option is set to yes, the plugin will send a welcome (or sorry-to-see-you-go mail) when a visitor subscribes to your newsletter (or unsubscribes). You can personalize these mails by editing the templates. Default value: Yes
If this option is set to yes the plugin will send an e-mail to the e-mail address you provided in ‘Mail address of sender’, every time a user subscribes or unsubscribes to your newsletter. You can personalize these mails by editing the templates Default value: Yes
If this option is set to yes the plugin will check the date of the most recent item and compare it with the ‘Timestamp of last time a newsletter was sent’ to see if there are new items since the last time a newsletter was sent. Only if there are new items a newsletter will be sent. If this option is set to No, the plugin will always send a newsletter even if there are no new items. (if you set the option to ‘yes’, and want to force the plugin to send a newsletter even if there are no new items you can append force=true to the url, see below) Default value: No
People that successfully subscribe to your newsletter will be redirected to this page (you can by example redirect them to a page saying “thank you for registering”) Default value: (url of your blog)
People that successfully unsubscribe from your newsletter will be redirected to this page Default value: (url of your blog)
This option is used by the plugin to store the date and time of the last time a newsletter was sent, so it can find out if there are new items before sending. You should NOT change the value for this option (unless you really know what you are doing )! (As of v1.2 this option will be read only when using Nucleus 3.1+CVS or higher)
To produce the newsletter the plugin uses a normal Nucleus Skin, meaning that the look-and-feel is completely customizable! So create a new skin inside Nucleus (and call it by example ““MyNewsletter”“). The only part of the skin you need is the ‘Main Index’-part, if you want to send the latest X items, or the archive part if you want to send the items of today (or yesterday, or maybe even this month ) Just edit the skin untill it looks like you want your newsletter to look like. You can also use some dynamic-variables in the skin to personalize the newsletter. Here are some usefull tips:
After creating your skin add <%MyNewsletter(start)%> to the top of your skin (so that it is the very first thing in the skin) and <%MyNewsletter(stop)%> at the end of your skin (so that it is the very last thing in the skin) (see below for more on this)
To let your visitors subscribe (or unsubscribe) to your newsletter, you can use the subscribe form in your normal skin by adding <%MyNewsletter(form)%> somewhere in the skin. When a visitor subscribes himself using this form he will be subscribed for the newsletter of the current blog. You can customize this form by editing ‘subscribe-form.inc.php’ in the ‘mynewsletter’-folder. I also provided an alternate form for people that have more than one blog and want let the visitor select the blog to which they want to subscribe by choosing it from a dropdown-list. To use the alternate form, simply rename ‘subscribe-form.inc.php’ to by example ‘subscribe-form.inc.php.bak’ and rename ‘subscribe-form.alternate.inc.php’ to ‘subscribe-form.inc.php’.
You can change the mails that are send to welcome a new subscriber or when he unsubscribes from your newsletter. Also the notification mails can be personalized. To do this simply edit the .template files in the folder of the language you have selected. Following templates are available:
In these templates you can also use the dynamic variables
After you completely set up all the options, skin, templates,.. you can send a first testmail. You do this by browsing to the url like: http://example.com/weblog/?skinid=5&checkword=MyCheckword&testmail=you@example.com . This supposes that:
You can always send a testmail to check if everything works or while you are creating a new layout for your newsletter (using a different skin), so you can preview it. Testmails are only sent to the address you enter in the url so it is save to send a testmail even if there are already people subscribed to your newsletter.
After you have edited all the options, created a skin, personalized the templates and successfully sent a testmail you can finally start sending your newsletter You can do this manually, or by using a cronjob. In both cases somebody (or in case of the cronjob: something (meaning: the server)) will have to browse a special page to start sending the newsletter. So to manually send the newsletter enter http://example.com/weblog/?skinid=5&checkword=MyCheckword in the address-bar of your browser and hit enter. If everything is ok your newsletter will now be sent. In this url you have the following parts which you should change according to your nucleus setup:
Important: If the blog for which you want to send the newsletter is not the default blog you’ll have to add an extra parameter to the url: &blogid=7 (where 7 is the id of the blog for which you want to send the newsletter)
You can setup a cronjob at the server to automatically send a newsletter every once in a while, by example every day at 10:00. To do this you must be able to create cronjobs at the server (contact your ISP for more info on setting up cronjobs). In the cronjob you should setup a command to let the php interpreter execute the same page as you would visit to manually send the newsletter. The command of a possible cronjob could be: /usr/bin/php /home/user/www/weblog/index.php skind=5 checkword=MyCheckword (where /usr/bin/php is the path to the php-interpreter and /home/user/www/weblog/index.php is the path (not url!) to the index.php file of your weblog. As an alternative it should also be possible to use the ‘curl’-command: curl http://example.com/weblog/?skinid=5&checkword=MyCheckword
Following is an overview of all available skinvars and their meaning:
In your newsletter skin and in the templates you can use some dynamic-variables to personalize the newsletter. Keep in mind that this will only work in the skin if the option ‘Send individual mails’ is set to ‘yes’.
As of v1.2 there is a ‘language selector’ build into the plugin. This means that you can simply select the language you want to use. (the pluginoptions themselves will not be translated!). Adding new languages is easy: If you downloaded a new language simply upload that folder (by example ‘french’) to mynewsletter/lang/, then edit the options of the plugin (by choosing ‘edit options’ in the Nucleus Admin Area) and refresh the page (using the refresh button of your browser or simply <F5>). MyNewsletter will then auto-detect the new language and add it to the select-box. Adding or modifying your own language is also easy: copy an existing language directory, rename it and edit the files. (if you made a translation for a language which is not yet provided with the plugin please give a shout so i can include it in the next release of the plugin!)
The plugin uses the Nucleus build-in logging system to log when a newsletter was send (or when somebody tried to send a newsletter but failed), and when visitors subscribe/unsubscribe. You can see this log by choosing ‘Action log’ form the quickmenu in the admin area.
Instead of sending the lates x-items of your blog you can choose to send all items of ‘today’ (or yesterday or this month or...) To do this simply use the ‘archive’-part of the newsletter skin instead of the ‘main index’-part and add an extra parameter, ‘archive’, to the url when sending the newsletter, to specify the day (or month) of which you want to send the items. To make it even easier I created two files called ‘today.php’ and ‘yesterday.php’, which can be found in the ‘mynewsletter/extra’-folder. Simply copy these files to the root of your Nucleus installation. Now you can browse to http://example.com/weblog/today.php and you will see only the items of today, to send the newsletter simply add the skinid and checkword parameters to the url. (same for yesterday.php ofcourse)