mirror of
https://github.com/ArthurDanjou/artdanj-api.git
synced 2026-01-31 11:57:50 +01:00
Update to v5
This commit is contained in:
22
app/Mailers/FormConfirmation.ts
Normal file
22
app/Mailers/FormConfirmation.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import mjml from 'mjml'
|
||||
import { BaseMailer, MessageContract } from '@ioc:Adonis/Addons/Mail'
|
||||
import View from "@ioc:Adonis/Core/View";
|
||||
|
||||
export default class FormConfirmation extends BaseMailer {
|
||||
|
||||
constructor (private name: string, private email: string) {
|
||||
super()
|
||||
}
|
||||
|
||||
public html = mjml(View.render('emails/confirmation_form', {
|
||||
name: this.name
|
||||
})).html
|
||||
|
||||
public prepare(message: MessageContract) {
|
||||
message
|
||||
.from('contact@arthurdanjou.fr')
|
||||
.to(this.email)
|
||||
.subject('Confirmation Form')
|
||||
.html(this.html)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user