* Add `Expiry` header to emails, set default expiry to 30 days and allow user config via `appsettings` * Remove `IsSmtpExpirationConfigured` as it will always have a value * Check for `emailExpiration` value * Removed `EmailExpiration` default value as it should be opt-in * Simplify SMTP email expiration condition * Fix APICompat issue * Add implementation to `NotImplementedEmailSender` * Rename `emailExpiration` to `expires` to match the SMTP header * Obsolete interfaces without `expires` parameter, delegate to an existing method. * Set expiry TimeSpan values from user configurable settings with defaults * Fix formating * Handle breaking changes, add obsoletion messages and simplify interfaces. * Fix default of invite expires timespan (was being parsed as 72 days not 72 hours). --------- Co-authored-by: Andy Butland <abutland73@gmail.com>
23 lines
1020 B
C#
23 lines
1020 B
C#
using Umbraco.Cms.Core.Models.Email;
|
|
|
|
namespace Umbraco.Cms.Core.Mail;
|
|
|
|
internal sealed class NotImplementedEmailSender : IEmailSender
|
|
{
|
|
public Task SendAsync(EmailMessage message, string emailType)
|
|
=> throw new NotImplementedException(
|
|
"To send an Email ensure IEmailSender is implemented with a custom implementation");
|
|
|
|
public Task SendAsync(EmailMessage message, string emailType, bool enableNotification) =>
|
|
throw new NotImplementedException(
|
|
"To send an Email ensure IEmailSender is implemented with a custom implementation");
|
|
|
|
public Task SendAsync(EmailMessage message, string emailType, bool enableNotification, TimeSpan? expires) =>
|
|
throw new NotImplementedException(
|
|
"To send an Email ensure IEmailSender is implemented with a custom implementation");
|
|
|
|
public bool CanSendRequiredEmail()
|
|
=> throw new NotImplementedException(
|
|
"To send an Email ensure IEmailSender is implemented with a custom implementation");
|
|
}
|