Simplenews publishes and sends newsletters to lists of subscribers.
This module generate the code for an iframe that will show a form to register a user in a newsletter.
There are some keys and a list of sites to check that the iframe is authorized.
The mainly idea to the use this module is together Simplenews Visitor or similar, so it's possible register a newsletter user from other sites (i.e. from the site owned by who after will use the Simplenews Visitor's services).
Requirements
Configuration
IFRAME GENERAL KEY
It needs a key to verify the authenticity of the URL inside the iframe. This is a general key that is combined with newsletters keys.
Once saved the key, it's important never change it to avoid that all URLs into the old iframe will be rejected.
IFRAME KEY
For every newsletter inside this new fieldset, 2 new newsletter options are required:
- the key to validate the iframe - the newsletter own key, which is combined with the general key;
- the URLs where are the iframes - a separated by commas string of domains or IPs where will have put the iframe code. If a site isn't in this list, then it will be rejected.
After have saved the page, there will be showed the iframe code to the copy in the remote site.
IFRAME CONFIRM URLs
If set Double on Opt-in/out method, it's possible to choice to use an internal "anonymous" page instead of the default pages from simplenews. This "anonymous" page will use the same CSS rules set in "IFRAME CSS".
There are also some templates to customize these "anonymous" pages (add logo, footer, etc.):
templates/page--simplenews-iregister-confirm.tpl.php
templates/page--simplenews-iregister-done.tpl.php
It's possible to define every template for a newsletter, renaming the templates like
page--simplenews-iregister-confirm--[tid].tpl.php
page--simplenews-iregister-confirm--add--[tid].tpl.php
page--simplenews-iregister-confirm--remove--[tid].tpl.php
page--simplenews-iregister-done--[tid].tpl.php
It's preferred copy/create them in your theme or subtheme.
Instead of the "done" template, it's possible to set an URL to your site or to the site where is the iframe or wherever, as further customized page.
IFRAME CSS
To optimize the iframe to be similar the remote site theme, it's possible to add the CSS rules for the iframe content and for the customized templates.
NOTES
The form in the iframe can be configured (block title and message) from the newsletter block configuration page.
The code above that you have copied in your site can also get the browser language and it send it to the module (if you have some site with the iframe before the 7.x-1.3 version, you need to update the code to get the language), so if you configure the language and you localize the block title and message, you have the iframe localized.
Like the confirmation pages, also for the iframe there are the templates to customize:
page--simplenews-iregister-iframe.tpl.php
or better
page--simplenews-iregister-iframe--[tid].tpl.php
Know issues
The process of authentication uses a list of URLs from which it accepts the iframe form.
To know that URL, I use the predefined variable $_SERVER['HTTP_REFERER']
but "This is set by the user agent. Not all user agents will set this, and some provide the ability to modify HTTP_REFERER as a feature. In short, it cannot really be trusted. " (http://us1.php.net/manual/en/reserved.variables.server.php) so it's possible that some browsers couldn't permit authentication.
Project information
- Module categories: Integrations
- 2 sites report using this module
- Created by stecalle on , updated
- Stable releases for this project are covered by the security advisory policy.
Look for the shield icon below.
Releases
Development version: 7.x-1.x-dev updated 24 Mar 2014 at 17:34 UTC