@xenterprises/fastify-xemail 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -35,7 +35,7 @@ await fastify.register(xEmail, {
35
35
  fastify.get('/send-welcome', async (request, reply) => {
36
36
  const { email, name } = request.query;
37
37
 
38
- await fastify.email.send(
38
+ await fastify.xEmail.send(
39
39
  email,
40
40
  'Welcome!',
41
41
  `<h1>Welcome ${name}!</h1>`,
@@ -48,16 +48,16 @@ fastify.get('/send-welcome', async (request, reply) => {
48
48
 
49
49
  ## API
50
50
 
51
- ### `fastify.email.send(to, subject, html, text, extraOptions)`
51
+ ### `fastify.xEmail.send(to, subject, html, text, extraOptions)`
52
52
  Send a single email.
53
53
 
54
- ### `fastify.email.sendTemplate(to, subject, templateId, dynamicData, extraOptions)`
54
+ ### `fastify.xEmail.sendTemplate(to, subject, templateId, dynamicData, extraOptions)`
55
55
  Send an email using a SendGrid dynamic template.
56
56
 
57
- ### `fastify.email.sendWithAttachments(to, subject, html, attachments)`
57
+ ### `fastify.xEmail.sendWithAttachments(to, subject, html, attachments)`
58
58
  Send an email with attachments.
59
59
 
60
- ### `fastify.email.validate(email)`
60
+ ### `fastify.xEmail.validate(email)`
61
61
  Validate an email address using SendGrid's Validation API.
62
62
 
63
63
  ## License
package/index.d.ts CHANGED
@@ -296,7 +296,7 @@ export interface XEmailPluginOptions {
296
296
  declare module 'fastify' {
297
297
  interface FastifyInstance {
298
298
  /** Email service methods */
299
- email: EmailService;
299
+ xEmail: EmailService;
300
300
  }
301
301
  }
302
302
 
@@ -317,7 +317,7 @@ declare module 'fastify' {
317
317
  * });
318
318
  *
319
319
  * // Send email
320
- * await fastify.email.send('user@example.com', 'Welcome', '<h1>Hello</h1>');
320
+ * await fastify.xEmail.send('user@example.com', 'Welcome', '<h1>Hello</h1>');
321
321
  * ```
322
322
  */
323
323
  declare const xEmail: FastifyPluginAsync<XEmailPluginOptions>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@xenterprises/fastify-xemail",
3
3
  "type": "module",
4
- "version": "1.0.1",
4
+ "version": "1.0.2",
5
5
  "description": "Fastify plugin for SendGrid email integration.",
6
6
  "main": "src/xEmail.js",
7
7
  "exports": {
package/src/xEmail.js CHANGED
@@ -22,7 +22,7 @@ async function xEmail(fastify, options) {
22
22
 
23
23
  console.info("\n 📧 Email Service (SendGrid) Initialized\n");
24
24
 
25
- fastify.decorate("email", {
25
+ fastify.decorate("xEmail", {
26
26
  /**
27
27
  * Send an email
28
28
  * @param {string|string[]} to - Recipient email(s)