I'm currently working on trying to build an email html template using swift mailer. My problem right now is how can I customize the template to fetch the values from the nodes and render them in the email template. Fetch and print/render the node values only from the nodes that will be sent as shown in the screenshot below.
Swift mailer has a default way to output the values from all the fields using
Is there a way I could access the values from the fields and render them on the template. Something like the code below that works on node template
or
Swift mailer has a way to render values via preprocess but I can't seem to make it work. Below is the code that is a work in progress
function swiftmailer_preprocess_swiftmailer(&$variables) {
$variables['node_title'] = $node->getTitle();
}
from Trying to access values from nodes to render in email template using swift mailer



No comments:
Post a Comment