2017-05-12 4 views
1

私はLaravelの組み込みログインシステム(php artisan make:auth)を使用していて、リセット電子メールを送信するために私のMailgunアカウントをリンクしました。しかし、どうすればタグを定義できますか?Laravel 5.3でパスワードリセット用のMailgunタグを追加

電子メールを送信する機能に、Mailgunのドキュメンテーションタグを追加する必要があります。私はその機能を見つけ、どのようにo:tagを追加することができます

https://documentation.mailgun.com/user_manual.html#tagging

'o:tag' => 'Password reset' 

答えて

1

ヘッダーで行うことができます。私はLaravel 5.5 with Mailableを使用しています

public function build() 
{ 
    $emailData = [ 
     'subject'  => $this->data['subject'], 
     'groupName'  => $this->data['groupName'], 
     'acceptUrl'  => $this->data['acceptUrl'], 
     'declineUrl' => $this->data['declineUrl'], 
     'email'   => $this->data['email'], 
    ]; 

    return $this 
     ->subject($this->data['subject']) 
     ->markdown('emails.group.invitation') 
     ->with($emailData) 
     ->withSwiftMessage(function($message) { 
      $headers = $message->getHeaders(); 
      $headers->addTextHeader("X-Mailgun-Variables", '{"type": "group-invitation"}'); 
      $headers->addTextHeader("X-Mailgun-Tag", "group-invitation"); 
     }); 
} 
関連する問題