Comment notification emails (#4978)
* Comment notification emails * fix links fix threading in email inboxes from is now commenter name * fix * refactor * fix async filter
This commit is contained in:
@@ -18,6 +18,7 @@ export default abstract class BaseEmail<T extends EmailProps, S = unknown> {
|
||||
* Schedule this email type to be sent asyncronously by a worker.
|
||||
*
|
||||
* @param props Properties to be used in the email template
|
||||
* @param metadata Optional metadata to be stored with the notification
|
||||
* @returns A promise that resolves once the email is placed on the task queue
|
||||
*/
|
||||
public static schedule<T>(props: T, metadata?: NotificationMetadata) {
|
||||
@@ -77,6 +78,7 @@ export default abstract class BaseEmail<T extends EmailProps, S = unknown> {
|
||||
try {
|
||||
await mailer.sendMail({
|
||||
to: this.props.to,
|
||||
fromName: this.fromName?.(data),
|
||||
subject: this.subject(data),
|
||||
previewText: this.preview(data),
|
||||
component: this.render(data),
|
||||
@@ -163,4 +165,9 @@ export default abstract class BaseEmail<T extends EmailProps, S = unknown> {
|
||||
* @returns A promise resolving to additional data
|
||||
*/
|
||||
protected beforeSend?(props: T): Promise<S | false>;
|
||||
|
||||
/**
|
||||
* fromName hook allows overriding the "from" name of the email.
|
||||
*/
|
||||
protected fromName?(props: T): string | undefined;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user