{"_id":"@arunvaradharajalu/common.mail-client","_rev":"1-4779e82532d397b876b0b80ebdf6b2b9","name":"@arunvaradharajalu/common.mail-client","description":"This package has a mail client which uses nodemailer under the hood for sending emails.","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"@arunvaradharajalu/common.mail-client","version":"1.0.0","keywords":["nodemailer-mail-client"],"author":{"name":"Arun Varadharajalu"},"license":"ISC","_id":"@arunvaradharajalu/common.mail-client@1.0.0","maintainers":[{"name":"arunvaradharajalu","email":"arunvaradharajalu@gmail.com"}],"homepage":"https://github.com/arunv11u/common.mail-client#readme","bugs":{"url":"https://github.com/arunv11u/common.mail-client/issues"},"dist":{"shasum":"4d27306d9eb4c089bd6998edb3f1849b08dd3531","tarball":"https://registry.npmjs.org/@arunvaradharajalu/common.mail-client/-/common.mail-client-1.0.0.tgz","fileCount":25,"integrity":"sha512-hP3OWrNF+k/M/ioQ2lj0XG6t14PudKYHipmHT4MQK/eSSurODgl16yg0CYVgf4liw/fp39mZD/MyXzH7kWhX5w==","signatures":[{"sig":"MEYCIQDc9TKTKMCwplF/UJiKY5iGOLRY9/A3kDLLwhM+9IkxEgIhAPW2CWHba4bFyJl/70GFxYaUy+22WcgOc7XhJHSMKcEu","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24595},"jest":{"roots":["<rootDir>/test"],"preset":"ts-jest","reporters":["default",["./node_modules/jest-html-reporter",{"pageTitle":"Mail Client Test Report"}]],"clearMocks":true,"testEnvironment":"node","setupFilesAfterEnv":["./test/setup.ts"]},"main":"./build/index.js","types":"./build/index.d.ts","gitHead":"c0d57a0b2a58b178c1709fe244fbbb69b3e29a5f","scripts":{"test":"jest --watchAll --verbose --no-cache --detectOpenHandles --env=node --coverage","build":"npm run clean && tsc --project tsconfig.build.json","clean":"rimraf build"},"_npmUser":{"name":"arunvaradharajalu","email":"arunvaradharajalu@gmail.com"},"repository":{"url":"git+https://github.com/arunv11u/common.mail-client.git","type":"git"},"_npmVersion":"10.2.4","description":"This package has a mail client which uses nodemailer under the hood for sending emails.","directories":{},"_nodeVersion":"20.11.0","dependencies":{"handlebars":"^4.7.8","nodemailer":"^6.9.14","@arunvaradharajalu/common.errors":"^1.1.0"},"_hasShrinkwrap":false,"devDependencies":{"nconf":"^0.12.1","rimraf":"^5.0.7","ts-jest":"^29.1.4","@types/jest":"^29.5.12","@types/nconf":"^0.10.6","@faker-js/faker":"^7.6.0","@types/nodemailer":"^6.4.15","jest-html-reporter":"^3.10.2"},"_npmOperationalInternal":{"tmp":"tmp/common.mail-client_1.0.0_1720307150163_0.227520104670204","host":"s3://npm-registry-packages"}},"1.0.1":{"name":"@arunvaradharajalu/common.mail-client","version":"1.0.1","description":"This package has a mail client which uses nodemailer under the hood for sending emails.","main":"./build/index.js","types":"./build/index.d.ts","scripts":{"clean":"rimraf build","build":"npm run clean && tsc --project tsconfig.build.json","test":"jest --watchAll --verbose --no-cache --detectOpenHandles --env=node --coverage"},"jest":{"preset":"ts-jest","testEnvironment":"node","setupFilesAfterEnv":["./test/setup.ts"],"roots":["<rootDir>/test"],"clearMocks":true,"reporters":["default",["./node_modules/jest-html-reporter",{"pageTitle":"Mail Client Test Report"}]]},"repository":{"type":"git","url":"git+https://github.com/arunv11u/common.mail-client.git"},"keywords":["nodemailer-mail-client"],"author":{"name":"Arun Varadharajalu"},"license":"ISC","bugs":{"url":"https://github.com/arunv11u/common.mail-client/issues"},"homepage":"https://github.com/arunv11u/common.mail-client#readme","devDependencies":{"@faker-js/faker":"^7.6.0","@types/jest":"^29.5.12","@types/nconf":"^0.10.6","@types/nodemailer":"^6.4.15","jest-html-reporter":"^3.10.2","nconf":"^0.12.1","rimraf":"^5.0.7","ts-jest":"^29.1.4"},"dependencies":{"@arunvaradharajalu/common.errors":"^1.1.0","handlebars":"^4.7.8","nodemailer":"^6.9.14"},"_id":"@arunvaradharajalu/common.mail-client@1.0.1","gitHead":"00b186885e9d23ad8844edc022a307b4b4b42114","_nodeVersion":"20.11.0","_npmVersion":"10.2.4","dist":{"integrity":"sha512-2q39C93sIDf2DGDJPvo4EUjfRPOszAuHMLaQ/jB0v0Oz1mKWBJlPZqprrYRASbWWXhJWnPrl0e1aCU/QM0rshA==","shasum":"a63db032d4588c7a9fc8743638b0625cccf4d62b","tarball":"https://registry.npmjs.org/@arunvaradharajalu/common.mail-client/-/common.mail-client-1.0.1.tgz","fileCount":25,"unpackedSize":24595,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD6ix50Shs7Jh2UVdsBK4lsUIXJIDVtmNLYY9TKlGqdBwIhALwjL/lWmeD/IjbckNLzAcbvWRZaKKCeDS1z5H/sDVpk"}]},"_npmUser":{"name":"arunvaradharajalu","email":"arunvaradharajalu@gmail.com"},"directories":{},"maintainers":[{"name":"arunvaradharajalu","email":"arunvaradharajalu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/common.mail-client_1.0.1_1720307740203_0.5425960561035079"},"_hasShrinkwrap":false}},"time":{"created":"2024-07-06T23:05:50.058Z","modified":"2024-07-06T23:15:40.589Z","1.0.0":"2024-07-06T23:05:50.295Z","1.0.1":"2024-07-06T23:15:40.409Z"},"maintainers":[{"name":"arunvaradharajalu","email":"arunvaradharajalu@gmail.com"}],"author":{"name":"Arun Varadharajalu"},"repository":{"type":"git","url":"git+https://github.com/arunv11u/common.mail-client.git"},"keywords":["nodemailer-mail-client"],"license":"ISC","homepage":"https://github.com/arunv11u/common.mail-client#readme","bugs":{"url":"https://github.com/arunv11u/common.mail-client/issues"},"readme":"# @arunvaradharajalu/common.mail-client\n\n[![npm version](https://badge.fury.io/js/%40arunvaradharajalu%2Fcommon.mail-client.svg)](https://badge.fury.io/js/%40arunvaradharajalu%2Fcommon.mail-client)\n[![GitHub issues](https://img.shields.io/github/issues/arunv11u/common.mail-client)](https://github.com/arunv11u/common.errors/mail-client)\n[![GitHub license](https://img.shields.io/github/license/arunv11u/common.mail-client)](https://github.com/arunv11u/common.mail-client/blob/master/LICENSE)\n\nThis package provides a mail client using nodemailer under the hood for sending emails.\n\n## Installation\n\nTo install the package, use npm or yarn:\n\n```bash\nnpm install @arunvaradharajalu/common.mail-client\n```\n\n## Usage\n\nHere is an example of how to use the mail client:\n\n```typescript\nimport { MailClientImpl } from '@arunvaradharajalu/common.mail-client';\n\n// Create an instance of the MailClientImpl\nconst mailClient = new MailClientImpl();\n\n// Set SMTP configuration\nmailClient.host = 'smtp.example.com';\nmailClient.port = 587;\nmailClient.user = 'your-email@example.com';\nmailClient.password = 'your-email-password';\n\n// Initialize the mail client\nmailClient.init();\n\n// Define the email message\nconst message = {\n    from: 'your-email@example.com',\n    to: 'recipient@example.com',\n    subject: 'Test Email',\n    text: 'This is a test email',\n    html: '<p>This is a test email</p>',\n};\n\n// Send the email\nmailClient.sendMail(message, message.html, message.subject, message.text)\n    .then(() => {\n        console.log('Email sent successfully!');\n    })\n    .catch(error => {\n        console.error('Error sending email:', error);\n    });\n```\n\n## API\n\n### `MailClientImpl`\n\n#### Properties\n\n- `host: string | null`\n\t- Sets the SMTP host.\n- `port: number | null`\n\t- Sets the SMTP port.\n- `user: string | null`\n\t- Sets the SMTP user.\n- `password: string | null`\n\t- Sets the SMTP password.\n\n#### Methods\n\n- `init(): void`\n\t- Initializes the mail client with the provided SMTP configuration.\n- `sendMail(message: MailMessage, html: string, subject: string, text: string): Promise<void>`\n\t- Sends an email with the provided message, HTML content, subject, and text content.\n- `getTemplateString(templateFolderPath: string, type: TemplateTypes): Promise<string>`\n\t- Retrieves the email template string from the specified folder path and type.\n- `compile(template: any, data: { [key: string]: any }): string`\n\t- Compiles the email template with the provided data.\n\n## Running Tests\n\nTo run the tests, use:\n\n```bash\nnpm test\n```\n\nThe test results will be generated in an HTML report with the title \"Mail Client Test Report\".\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a pull request or open an issue for bug fixes, improvements, or new features.\n\n## Author\n\nArun Varadharajalu\n\n## License\n\nThis project is licensed under the ISC License.","readmeFilename":"README.md"}