placeholders in scheduled email

prophoto

Active Member
For some reason placedholders are not working correctly in scheduled emails. Only the raw values show, with or without _raw.

Please see my ccb site.
 
Yeah, that's why I said don't use the cron email, and offered to tweak the form plugin so you could save the PDF, and send that as an attachment from the IPN code. The cron doesn't render the form (i.e. process all the elements and format them for display), it just reads the row data.

The cron email isn't designed for "heavy weight" emails. Rendering emails for form display is a very resource intensive task. That's why loading forms takes a few seconds, just for a single form. Imagine trying to load and render (say) a thousand rows in a cron run - it'd be like rendering a thousand forms.

I can look at adding an option to do that, but I'm kind of slammed busy at the momen, with fallout from the 3.3 release.

-- hugh
 
I may be able to just write the whole email with a few php if/else commands to get what I need done instead of processing the labels. Is there a sample email message with php turned on that I can go by? I tried a few things but I keep getting "message body empty" error.


Screen Shot 2015-03-05 at 6.32.36 PM.png
 
I'm not quite sure what you need from me. I can't really "give you an overview", you either have the skills you need to write it, or you don't. I spent quite a while discussing this with you, and I've already pointed you at the code in the form email plugin which does this kind of stuff, that could probably be adapted and used in a cron plugin.

I also made it fairly clear I don't think you can do what you need from cron, that the best approach is the one I described, which would be an extra option added to the email plugin, to allow you to "stash" the PDF, and just pick it up and send it when the IPN 'success' callback happens. Or you could do the same thing out of cron. But trying to build fully formatted emails from scratch in cron (or in the IPN handling) would require quite a fair amount of coding.

-- hugh
 
Final answer was to not include opening and closing php tags, then enclose html in $output.

Code:
$othervar=5;

$output = '<p>Here is your html code</p> <p> And other info '.$othervar.'</p>';

return $output;
 
Thanks for summarizing our Skype session. And yeah, I forgot to mention you don't need the opening PHP tag, which is true for any of our "eval" code options throughout Fabrik.

-- hugh
 
I was just seeing this issue again, trying to run a cron and getting "message body empty" error. Ended up being a ' in the name field. That ' would close the output = ' '; tag prematurely.

So...how do I make sure this does not happen again? Right now I am writing the name field like this inside of the output tag.

Code:
<p>{ccb_tickets___name_raw}<br />

I am guessing I need to search/replace somehow? I removed the offending ' from the field to process her ticket, but need to make sure this doesn't happen again.
 
So preg_replace does the trick...

Code:
$personname = "{ccb_tickets___name_raw}";
$personname = preg_replace("/'/", "&#39;", $personname);

Any other suggestions?
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top