简体   繁体   English

如何将变量传递给mailgun默认电子邮件模板

[英]How to pass variable to mailgun default email template

I use mailgun and integrated with php.我使用mailgun并与php集成。 The mail sends fine without error.邮件发送正常,没有错误。 I create a default template in mailgun(Action Template).我在 mailgun(操作模板)中创建了一个默认模板。 In that template there is a button.在那个模板中有一个按钮。 My Issue is我的问题是

How to i pass a parameter to that button a tag MY code is如何将参数传递给该按钮 标签我的代码是

$mg = Mailgun::create('MY API');
// Now, compose and send your message.
$result = $mg->messages()->send('MY DOMAIN NAME', [
'from' => 'support@figjam.net',
'to' => $email,
'subject' => 'Confirm Your E-mail',
'html' => ' <p>Please confirm your email address by click the link below <br>
<a href="'.$base_url.'/activate.php?id='.base64_encode($lastID).'"><button type="button" class="btn btn-secondary">CLICK TO ACTIVATE YOUR ACCOUNT</button></a></p>'
'template'    => 'verifyemail'      
]);

I need to pass variable to that template verifyemail我需要将变量传递给该模板verifyemail

Kindly Help me fix this.请帮我解决这个问题。 Thanks谢谢

Let's assume you have myvariable with value someVariableValue假设您有myvariable的值someVariableValue

  'template'    => 'verifyemail',
  'v:myvariable' => 'someVariableValue',
]);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM