Jump to content

is PW newsletter made in PW?


clsource
 Share

Recommended Posts

  • 2 months later...

@adrianmak

In the Netherlands there are a lot of rules that must be fulfilled for sending news letters. This brings big responsibility to the end user of the system. When you really trust the user with the sending and subscribe and un-subscribe system you could go that way. When done wrong it's not uncommon that your IP gets blocked or you've to pay big fines as stated by law.

The markup generation can be done with ProcessWire ( Don't know any system that handles this better ), but I recommend for the sending an external service. Those services have you covered with good subscribe and un-subscribe systems.

  • Like 6
Link to comment
Share on other sites

Is there any examples on using processwire to create a mass mailer newsletter? I have a client that will want the ability to select news articles as a newsletter. It's also something that I would like some experience with so that I could create some sort of module that I could use in the future. 

A couple specific things that I have questions about. 

Do you inline your styling directly into the message from a separate style sheet, if so how do you manage the process? 

How do you manage your email lists?

For your back end interface, is this a module that is available in the modules section or something that would need to be custom tailored?

What does your email template look like, all those <tr> <td> tags make my head spin.

Link to comment
Share on other sites

Do you inline your styling directly into the message from a separate style sheet, if so how do you manage the process? [/font][/color]

Every HTML element get inline styles, external stylesheets can't be used. Some clients like GMail even drops the the whole <head> element. Be aware of that outlook doesn't render with a normal render engine, it uses MS Word to render the news letters. It even has it's own conditional statements like: <!--[if gte mso 9]>

How do you manage your email lists?

Newsletters are heavy for your server, sending part (CPU) and network traffic by the delivering of the assets with very high peaks. Then I guess the customer want to some kind of report like view statistics click rates etc. You've to build the unsubscribe/subscribe part. It's a tremendous lot of work, Is this really worth it ? Maybe as a study project or as an opensource project. And please read my post above.

I would say don't do this yourself (commercially). Go for a service.

For your back end interface, is this a module that is available in the modules section or something that would need to be custom tailored?

I would just use simple page templates for this. Maybe a structure like:

/newsletter/ <--- use this source code
 |
 +- header of letter ( let it render in /newsletter/ )
 |
 +- article ( let it render in /newsletter/ )
 |
 +- article 2 ( let it render in /newsletter/ )
 |
 +- footer ( let it render in /newsletter/ )

What does your email template look like, all those <tr> <td> tags make my head spin.

There's not much different from using tables then using the markup from CSS frameworks like Bootstrap. A bit of source code tels it all.

// grid with tables        // the 'new' grid
<table>                 <div class='container'>
    <tr>                    <div class='row'>
        <td></td>               <div class='col-md-etc'></div>
        <td></td>               <div class='col-md-etc'></div>
    </tr>                   </div>
</table>                </div>
Link to comment
Share on other sites

  • 5 months later...

How do you guys deal with images? I am trying to use a CKEditor field for my email body, but all of the images use relative linking :(

Just some thoughts - i've not used such code -  but could not a simple textformatter change this stuff:

// output relative url
echo $img->url;

// output absolute url
echo $img->httpUrl;

regards mr-fan

Link to comment
Share on other sites

i'm doing this which works:

$base_url = 'http://' . wire('config')->httpHost . '/';

$placeholders = array('class="align_left"', 'site/assets/files/');
$replacements = array('style="float:left;margin-right:10px;"', $base_url . 'site/assets/files/');    
$body = str_replace($placeholders, $replacements, $message->body);
Edited by Macrura
fixed $base_url
  • Like 2
Link to comment
Share on other sites

Hey Macrura!

Your post got me going in the right direction. I had to modify it a bit. $config->urls->root->httpUrl returns an error, so I had to use 'https://' . wire('config')->httpHost . '/'.

I'm also looking for links without the http:// and adding that in so that they'll work either way.

Instead of just targeting the assets folder, I'm replacing all instances of relative links ('href="/' or 'src="/') and adding in the site's base URL. It seems to be working.

$base_url = 'https://' . wire('config')->httpHost . '/';
		$placeholders = array('class="align_left"', 'src="/', 'href="/', 'href="www.', 'src="www.');
		$replacements = array('style="float:left;margin-right:20px;"', 'src="' . $base_url, 'href="' . $base_url, 'href="http://www.', 'src="http://www.');  
		$body = str_replace($placeholders, $replacements, $body);
  • Like 2
Link to comment
Share on other sites

 Share

×
×
  • Create New...