You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import{test}from'@japa/runner'importmailfrom'@adonisjs/mail/services/main'importVerifyEmailNotificationfrom'#mails/verify_email'test.group('Users | register',()=>{test('create a new user account',async({ client, route })=>{/** * Turn on the fake mode */const{ mails }=mail.fake()/** * Make an API call */awaitclient.post(route('users.store')).send(userData)/** * Assert the controller indeed sent the * VerifyEmailNotification mail */mails.assertSent(VerifyEmailNotification,({ message })=>{returnmessage.hasTo(userData.email).hasSubject('Verify email address')})})})
And here is my code with all errors :
And here is my mail class :
importenvfrom'#start/env'import{BaseMail}from'@adonisjs/mail'exportdefaultclassSendPasswordTokenNotificationextendsBaseMail{from=env.get('SENDER_EMAIL')subject='Votre code de réinitialisation de mot de passe'to: stringpayload: anyconstructor(privateemail: string,privatedata: {token: string}){super()this.to=emailthis.payload=data}/** * The "prepare" method is called automatically when * the email is sent or queued. */prepare(){this.message.to(this.to)this.message.htmlView('emails/send_password_token',this.payload)}}
(I don't know if it's the good way to pass data in the mail class but the documentation doesn't show it :/)
Reproduction repo
No response
The text was updated successfully, but these errors were encountered:
There was an issue with assertSent method and other similar methods where they did not allow Mail classes that accepts constructor argument. This issue has been fixed.
Another issue is with the docs related to the following code snippet.
Package version
9.2.0
Describe the bug
Hi, i tried to do like the documentation :
And here is my code with all errors :
And here is my mail class :
(I don't know if it's the good way to pass data in the mail class but the documentation doesn't show it :/)
Reproduction repo
No response
The text was updated successfully, but these errors were encountered: