v0.3.3
版本发布时间: 2021-12-16 21:55:43
novuhq/novu最新发布版本:v0.24.0(2024-03-18 17:44:43)
What's new?
- Email attachments support
- New direct messaging interface
- New NestJS module for Notifire by @devblin in https://github.com/notifirehq/notifire/pull/106
- New readme file for our npm package by @SachinHatikankar100 in https://github.com/notifirehq/notifire/pull/121
- Code generator for SMS providers by @galezra in https://github.com/notifirehq/notifire/pull/131
- Docs for generating a new provider by @cloudguruab in https://github.com/notifirehq/notifire/pull/132
Email attachments support
This incredible community effort started from @davidsoderberg who took on him to finalize the interface for the $attachments
and later on all the community took the effort to update all of our 9 email providers.
So how this works?
The $attachment
interface receives an array of attachment objects. Each attachment contains a file buffer, the mime type and the attachment name to be used.
const fileBuffer = fs.readFileSync('event.ics');
await notifire.trigger('test', {
$user_id: '1234',
$email: 'recipient@email.com',
$attachments: [{
file: fileBuffer,
mime: 'text/plain',
name: 'event.ics'
}]
});
NestJS module
Created by @devblin you can now use notifire in your nestjs application easily by installing the @notifire/nest
package.
Initializing module with templates and providers:
import { NotifireModule } from "@notifire/nest";
@Module({
imports: [
NotifireModule.forRoot({
providers: [
new SendgridEmailProvider({
apiKey: process.env.SENDGRID_API_KEY,
from: 'sender@mail.com',
}),
],
templates: [
{
id: 'password-reset',
messages: [
{
subject: 'Your password reset request',
channel: ChannelTypeEnum.EMAIL,
template: `
Hi {{firstName}}!
To reset your password click <a href="{{resetLink}}">here.</a>
`,
},
],
},
],
}),
],
})
Using notifire's singleton service in other services and modules:
import { Injectable } from '@nestjs/common';
import { NotifireService } from '@notifire/nest';
@Injectable()
export class UserService {
constructor(private readonly notifire: NotifireService) {}
async triggerEvent() {
await this.notifire.trigger('password-reset', {
$email: 'reciever@mail.com',
$user_id: 'id'
});
}
}
Mail attachments contributors
- Add Attachments Interface by @davidsoderberg in https://github.com/notifirehq/notifire/pull/93
- Added attachment support for mailjet provider by @devblin in https://github.com/notifirehq/notifire/pull/116
- Nodemailer attachments support by @galezra in https://github.com/notifirehq/notifire/pull/120
- Postmark attachments support by @galezra in https://github.com/notifirehq/notifire/pull/119
- Sendgrid attachments support by @galezra in https://github.com/notifirehq/notifire/pull/117
- Added attachment support to mailgun by @l0ne in https://github.com/notifirehq/notifire/pull/122
- Mandrill attachment by @diganta413 in https://github.com/notifirehq/notifire/pull/124
- Added SES attachments support by @galezra in https://github.com/notifirehq/notifire/pull/129
- Addd emailjs attachment support by @peoray in https://github.com/notifirehq/notifire/pull/130
New providers
- Added Sendinblue as a provider by @galezra in https://github.com/notifirehq/notifire/pull/111
- Added Nexmo/Vonage SMS by @ranrib in https://github.com/notifirehq/notifire/pull/136
- Added sms77 as an SMS provider @matthiez in https://github.com/notifirehq/notifire/pull/134
Other changes
- Fixed typo at the quick-start docs page by @chasmfiend in https://github.com/notifirehq/notifire/pull/110
New Contributors in this version
- @chasmfiend made their first contribution in https://github.com/notifirehq/notifire/pull/110
- @devblin made their first contribution in https://github.com/notifirehq/notifire/pull/106
- @galezra made their first contribution in https://github.com/notifirehq/notifire/pull/111
- @l0ne made their first contribution in https://github.com/notifirehq/notifire/pull/122
- @cloudguruab made their first contribution in https://github.com/notifirehq/notifire/pull/132
- @matthiez made their first contribution in https://github.com/notifirehq/notifire/pull/134
- @peoray made their first contribution in https://github.com/notifirehq/notifire/pull/130
- @ranrib made their first contribution in https://github.com/notifirehq/notifire/pull/136