mailConfig static method
lib/config/mail.dart for transport
Implementation
static String mailConfig(String transport) {
return '''
import 'package:dox_core/dox_core.dart';
import 'package:dox_mailer/dox_mailer.dart';
/// Mail settings
/// -------------------------------
/// `defaultMailer`: the mailer that `Mail.send()` uses. It is a key of
/// `mailers`. Set `MAIL_MAILER` in .env to change it.
/// `from`: the from address of a message that has none.
/// `mailers`: each mailer name and its transport. `log` prints emails
/// and sends nothing.
MailConfig mailConfig = MailConfig(
defaultMailer: Env.get('MAIL_MAILER', '$transport'),
from: Address(Env.get('MAIL_FROM', 'hello@example.com'), 'My app'),
mailers: <String, Transport>{
${_mailer(transport)} 'log': LogTransport(),
},
);
''';
}