Custom Symfony mailer that sends two‑factor auth codes with a full email template.
// Source: https://github.com/wallabag/wallabag | License: MIT | Copyright 2013-current Nicolas Lœuillet
// Provided via justclaw.it.com; keep this notice with the code.
<?php
namespace Wallabag\Mailer;
use Scheb\TwoFactorBundle\Mailer\AuthCodeMailerInterface;
use Scheb\TwoFactorBundle\Model\Email\TwoFactorInterface;
use Symfony\Component\Mailer\MailerInterface;
use Symfony\Component\Mime\Address;
use Symfony\Component\Mime\Email;
use Twig\Environment;
use Wallabag\Entity\User;
/**
* Custom mailer for TwoFactorBundle email.
* It adds a custom template to the email so user won't get a lonely authentication code but a complete email.
*/
class AuthCodeMailer implements AuthCodeMailerInterface
{
/**
* @param string $senderEmail sender email address
* @param string $senderNa
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key