#include <email.h>
|
| static std::string | verificationEmailHtml (const std::string &app_name, const std::string &verify_url) |
| static std::string | verificationEmailText (const std::string &app_name, const std::string &verify_url) |
| static std::string | passwordResetEmailHtml (const std::string &app_name, const std::string &reset_url) |
| static std::string | passwordResetEmailText (const std::string &app_name, const std::string &reset_url) |
| static std::string | loginOtpEmailHtml (const std::string &app_name, const std::string &code, int expires_minutes) |
| static std::string | loginOtpEmailText (const std::string &app_name, const std::string &code, int expires_minutes) |
◆ MbMailer()
◆ applySettings()
| void mb::MbMailer::applySettings |
( |
const json & | configs | ) |
|
Load the smtp object from application settings. An empty or incomplete host leaves the mailer unconfigured.
◆ checkRateLimit()
| bool mb::MbMailer::checkRateLimit |
( |
const std::string & | email, |
|
|
int | max_per_hour = 3 ) |
◆ clearRateLimits()
| void mb::MbMailer::clearRateLimits |
( |
| ) |
|
◆ clearSentMessages()
| void mb::MbMailer::clearSentMessages |
( |
| ) |
|
◆ config()
◆ configure()
◆ isConfigured()
| bool mb::MbMailer::isConfigured |
( |
| ) |
const |
◆ loadTemplate()
| std::string mb::MbMailer::loadTemplate |
( |
const std::string & | template_name, |
|
|
const std::unordered_map< std::string, std::string > & | variables ) const |
◆ loginOtpEmailHtml()
| std::string mb::MbMailer::loginOtpEmailHtml |
( |
const std::string & | app_name, |
|
|
const std::string & | code, |
|
|
int | expires_minutes ) |
|
static |
◆ loginOtpEmailText()
| std::string mb::MbMailer::loginOtpEmailText |
( |
const std::string & | app_name, |
|
|
const std::string & | code, |
|
|
int | expires_minutes ) |
|
static |
◆ passwordResetEmailHtml()
| std::string mb::MbMailer::passwordResetEmailHtml |
( |
const std::string & | app_name, |
|
|
const std::string & | reset_url ) |
|
static |
◆ passwordResetEmailText()
| std::string mb::MbMailer::passwordResetEmailText |
( |
const std::string & | app_name, |
|
|
const std::string & | reset_url ) |
|
static |
◆ send()
| bool mb::MbMailer::send |
( |
const MbEmailMsg & | message | ) |
|
Deliver a message. Mock hosts (mock, localhost:0) capture it in sentMessages() and do not connect. Otherwise the message is sent over SMTP on a trantor TCP connection. Throws MbException on validation errors, rate limits, or delivery failure.
◆ sendTest()
| bool mb::MbMailer::sendTest |
( |
const std::string & | to | ) |
|
Send a fixed "Hey, it works!" message to to. Throws MbException when SMTP is not configured, the address is invalid, the rate limit is exceeded, or delivery fails.
◆ sentMessages()
| const std::vector< mb::MbEmailMsg > & mb::MbMailer::sentMessages |
( |
| ) |
const |
Messages captured by the mock transport.
◆ verificationEmailHtml()
| std::string mb::MbMailer::verificationEmailHtml |
( |
const std::string & | app_name, |
|
|
const std::string & | verify_url ) |
|
static |
◆ verificationEmailText()
| std::string mb::MbMailer::verificationEmailText |
( |
const std::string & | app_name, |
|
|
const std::string & | verify_url ) |
|
static |
◆ kNotConfiguredMessage
| std::string_view mb::MbMailer::kNotConfiguredMessage |
|
staticconstexpr |
Initial value:{
"Email service not configured. Set SMTP settings first."
}
Returned by send() and sign-in code requests when SMTP is not configured.
◆ kTestMessage
| std::string_view mb::MbMailer::kTestMessage {"MantisBase: Hey, it works!"} |
|
staticconstexpr |
The documentation for this class was generated from the following files:
- /home/runner/work/mantisbase/mantisbase/include/mantisbase/core/email.h
- /home/runner/work/mantisbase/mantisbase/src/core/email.cpp