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?
Any thoughts?
Type: | Discussion |
---|---|
Status: | New |
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?
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.
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
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
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();
$c = Page::getByPath( $requestedURL );
$a = new Area( $areaHandle );
ob_start();
$a->display($c);
$html = ob_get_contents();
ob_end_clean();
Tony,
FWIW, I code CSS at the tag level for emails, and it's generally well-accepted by most email clients. For example:
...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...
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...
yeah, that kind of inline css usually is fine, although I think some browser based email clients only allow certain style rules.