What's new?
- Email attachments support
- New direct messaging interface
- New NestJS module for Notifire by @devblin in #106
- New readme file for our npm package by @SachinHatikankar100 in #121
- Code generator for SMS providers by @galezra in #131
- Docs for generating a new provider by @cloudguruab in #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 #93
- Added attachment support for mailjet provider by @devblin in #116
- Nodemailer attachments support by @galezra in #120
- Postmark attachments support by @galezra in #119
- Sendgrid attachments support by @galezra in #117
- Added attachment support to mailgun by @l0ne in #122
- Mandrill attachment by @diganta413 in #124
- Added SES attachments support by @galezra in #129
- Addd emailjs attachment support by @peoray in #130
New providers
- Added Sendinblue as a provider by @galezra in #111
- Added Nexmo/Vonage SMS by @ranrib in #136
- Added sms77 as an SMS provider @matthiez in #134
Other changes
- Fixed typo at the quick-start docs page by @chasmfiend in #110
New Contributors in this version
- @chasmfiend made their first contribution in #110
- @devblin made their first contribution in #106
- @galezra made their first contribution in #111
- @l0ne made their first contribution in #122
- @cloudguruab made their first contribution in #132
- @matthiez made their first contribution in #134
- @peoray made their first contribution in #130
- @ranrib made their first contribution in #136