d6fc477636
Closes #73 and #77
24 lines
572 B
JavaScript
24 lines
572 B
JavaScript
class UserSubscriber {
|
|
constructor({ sendgridService, eventBusService }) {
|
|
this.sendgridService_ = sendgridService
|
|
|
|
this.eventBus_ = eventBusService
|
|
|
|
this.eventBus_.subscribe("user.password_reset", async (data) => {
|
|
await this.sendgridService_.transactionalEmail(
|
|
"user.password_reset",
|
|
data
|
|
)
|
|
})
|
|
|
|
this.eventBus_.subscribe("customer.password_reset", async (data) => {
|
|
await this.sendgridService_.transactionalEmail(
|
|
"customer.password_reset",
|
|
data
|
|
)
|
|
})
|
|
}
|
|
}
|
|
|
|
export default UserSubscriber
|