themes - Problems theming Drupal 8 + SwiftMailer contact email -
i'm trying use swiftmailer theme contact email in drupal 8 site, having difficulties.i'm trying use default theme file swiftmailer renders body. how can access each field individually?
what want this:
{# /** * @file * default template file e-mails. * * available variables: * - subject: subject. * - body: message content. * - message: $message array created , used in mail building * procedure. content varies between cases, typically contains @ * least following elements: * - id: message identifier. * - module: module handles building of message. * - key: key of message. * - to: recipient email address. * - from: email address of sender. * - langcode: langcode use compose e-mail. * - params: message parameters. * * template may overriden module and/or mail key, using of * following template names: * - swiftmailer.html.twig: global, used default. * - swiftmailer--mymodule.html.twig: emails sent module "mymodule". * - swiftmailer--mymodule--test.html.twig: emails module * "mymodule" key "test". * * @see template_preprocess() * @see template_preprocess_swiftmailer() * * @ingroup themeable */ #} <html> <head> <style type="text/css"> table tr td { font-family: arial; font-size: 12px; } td .field { width: 50px; } </style> </head> <body> <div> <table width="800px" cellpadding="0" cellspacing="0"> <tr> <td class="field">nome</td> <td>{{ body.name }}</td> </tr> <tr> <td class="field">email</td> <td>{{ body.mail }}</td> </tr> <tr> <td class="field">motivo</td> <td>{{ body.motivo }}</td> </tr> <tr> <td class="field">titulo</td> <td>{{ body.subject }}</td> </tr> <tr> <td class="field">mensagem</td> <td>{{ body.message }}</td> </tr> </table> </div> </body> </html>
it seems simple it's taking time. "body.something" blank.
thanks
parameters emails (of course depends on implementation) in message.params
. suggest use message.params
access variables need.
also, help, can use devel module , use {{ dump() }}
print out variables available in theme file , there discover stuff is.
Comments
Post a Comment