Search the Community
Showing results for tags 'syntax'.
Found 4 results
I have a page which sends out an email based on queries in the url <?php // event ID $eventID = $input->get('eventID','int'); $event = $pages->get($eventID); // config $adminEmail = "firstname.lastname@example.org"; $fromEmail = "email@example.com"; $fromName = "test"; $emailSubject = "Test Email"; // HTML BODY $emailBody = ""; // HOW TO ??? … // send mail $m = new WireMail(); $m->to($adminEmail); $m->from($fromEmail, $fromName); $m->subject($emailSubject); $m->bodyHTML($emailBody); $m->send(); ?> The email body is a bit complex: standard html/css tables and some php (pw variables). I put my emailbody (html) in a seperate file emailbody.inc but don't know how to include it?
How should messages for Wire or $mail->send() be formatted? There is some information here; you can send text and html versions, but there are no examples how to format those. /n or /r/n etc. is ignored for the text version. What syntax should be used to get line breaks in the email? For the html version, it would be nice if you could pull that from a field. For most emails you would need to be able to insert the recipient's name and other data. PHP variables don't work in field content. Are there other ways to achieve this; replace a tag in the field body with data from php script in the template? Maybe with Hanna Code? Or is that what RuntimeMarkupField is for?
Hi, I'm curious if anyone has implemented some sort of template ala twig, liquid, mustache, handlebars etc. so on and so forth? I noticed a blog post about blog themes which needed to be easier to work with than WP and using a simplified template syntax would definitely help for non-php-ers.