include page dynamically in email

Permalink Browser Info Environment
I'm trying to figure out how to include an existing HTML page in an email. I can do it outside of C5, just trying to figure out how to make it work within your mailing list tool.

Any thoughts?

Type: Discussion
Status: New
invision
View Replies:
invision replied on at Permalink Reply
invision
I have a cURL routine that does this outside of C5. Is there a way to embed PHP code in the email form page without hacking the core of your add-on?
Tony replied on at Permalink Reply
Tony
the problem with doing this kind of thing is that once you send the email, it won't send the css styling from your HTML. This is because most email clients simply won't work with standard HTML and CSS that is used on most websites. instead, they tend to only support inline css and more old school html. You can always just try copying and pasting content into the mailing list text editor, but do a test email first and have a look in a few different clients to make sure it comes through looking good. If you're just wanting to send the main text from that HTML page through, then all of the styling constraints are somewhat irrelevant. And no, the mailing list package currently does not include a feature to automatically import the text from one of your pages, so you're best off just using copy and paste.
invision replied on at Permalink Reply
invision
Tony,

I'm trying to dynamically include a page in the email that changes daily - cut and paste won't work for this application.

If the email form would support parsing php code, then I'd be In Like Flint. Instead, it appears to strip out anything other than text or HTML (pasted thru the WYSIWYG editor).

I might try embedding some jQuery in the HTML to see if that will work, otherwise, I'll have to hack into your core.

I've worked with other CMSes that would allow you to email an article from the website. That's what I'm trying to achieve.

Thanks for the quick reply.

Sherm Stevens
http://www.invsion-studios.com
Tony replied on at Permalink Reply
Tony
Well, if you're going to try customizing it, you can do something like this:

$c = Page::getByPath( $requestedURL );

$a = new Area( $areaHandle );

ob_start();
$a->display($c);
$html = ob_get_contents();
ob_end_clean();
invision replied on at Permalink Reply
invision
Tony,

FWIW, I code CSS at the tag level for emails, and it's generally well-accepted by most email clients. For example:

<h1 style="font-family:Arial,Helvetica,sans-serif; color:#000">Our First Newsletter<h1>


...rather than trying to pick up the code from an external css file or embedded in the page header.

Sherm Stevens
http://www.invision-studios.com...
Tony replied on at Permalink Reply
Tony
yeah, that kind of inline css usually is fine, although I think some browser based email clients only allow certain style rules.

concrete5 Environment Information

Browser User-Agent String

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.