Never Propel Marmalade

    @emailjs/browser
    TypeScript icon, indicating that this package has built-in type declarations

    3.10.0 • Public • Published

    Official EmailJS SDK for Browsers

    SDK for EmailJS.com customers.
    Use you EmailJS account for sending emails.

    codecov npm version

    Disclaimer

    This is a browser-only version, otherwise use

    Links

    Official SDK Docs

    Intro

    EmailJS helps to send emails using client-side technologies only. No server is required – just connect EmailJS to one of the supported email services, create an email template, and use our SDK to trigger an email.

    Usage

    Install EmailJS SDK using npm:

    $ npm install @emailjs/browser

    Or manually:

    <script
      type="text/javascript"
      src="https://cdn.jsdelivr.net/npm/@emailjs/browser@3/dist/email.min.js">
    </script>
    <script type="text/javascript">
      (function () {
        emailjs.init('<YOUR_PUBLIC_KEY>');
      })();
    </script>

    Examples

    send email

    var templateParams = {
        name: 'James',
        notes: 'Check this out!'
    };
    
    emailjs.send('<YOUR_SERVICE_ID>','<YOUR_TEMPLATE_ID>', templateParams)
    	.then(function(response) {
    	   console.log('SUCCESS!', response.status, response.text);
    	}, function(err) {
    	   console.log('FAILED...', err);
    	});

    send form

    emailjs.sendForm('<YOUR_SERVICE_ID>','<YOUR_TEMPLATE_ID>', '#myForm')
    	.then(function(response) {
    	   console.log('SUCCESS!', response.status, response.text);
    	}, function(err) {
    	   console.log('FAILED...', err);
    	});

    Angular X / VueJS / ReactJS

    import emailjs from '@emailjs/browser';
    
    const templateParams = {
        name: 'James',
        notes: 'Check this out!'
    };
    
    emailjs.send('<YOUR_SERVICE_ID>','<YOUR_TEMPLATE_ID>', templateParams, '<YOUR_PUBLIC_KEY>')
    	.then((response) => {
    	   console.log('SUCCESS!', response.status, response.text);
    	}, (err) => {
    	   console.log('FAILED...', err);
    	});

    Install

    npm i @emailjs/browser

    DownloadsWeekly Downloads

    19,134

    Version

    3.10.0

    License

    BSD-3-Clause

    Unpacked Size

    167 kB

    Total Files

    29

    Last publish

    Collaborators

    • sergey-emailjs