An warware: shigar da emailjs

EmailJS yana ษ—aya daga cikin shahararrun sabis waษ—anda ke sauฦ™aฦ™e aika imel kai tsaye daga gidan yanar gizo, ba tare da buฦ™atar uwar garken baya ba. Wannan sabis ษ—in yana da sha'awa musamman saboda yana iya gudana gaba ษ—aya a cikin abokin ciniki, yana guje wa farashin uwar garken da sauฦ™aฦ™e gine-gine. Menene ฦ™ari, haษ—a wannan sabis ษ—in tare da JavaScript na iya ฦ™ara haษ“aka ingancin sabis ษ—in da ke jawo yawancin masu amfani da koyo.

Amfani da EmailJS

EmailJS yana ba da damar aika imel kai tsaye daga JavaScript, ba tare da lamuni ba. Wannan babbar fa'ida ce, musamman ga waษ—anda ke gudanar da tsayayyen gidajen yanar gizo ko ฦ™a'idodin da ba su da nasu abubuwan da ke gefen uwar garken. Tare da EmailJS, zaku iya aika imel kawai ta aiwatar da ษ—an lambar JavaScript.

Bugu da kari, wannan gine-gine marar sabar ba shi da tsada kuma ba shi da wahala. Mutum na iya amfani da samfuran imel da aka riga aka ฦ™ayyade kuma ya sauฦ™aฦ™a aiwatar da aika nau'ikan imel daban-daban. EmailJS, don haka, yana da babban maki mai amfani idan ya zo ga sauฦ™aฦ™e coding.

Yadda ake Sanya EmailJS

Tsarin shigar da EmailJS yana da sauฦ™i.

npm install emailjs --save

Umurnin da ke sama zai shigar da EmailJS cikin aikin ku. Ka tuna adana shi don a ฦ™ara shi zuwa abubuwan dogara a cikin fayil ษ—in ku na kunshin.json.

Ana aiwatar da ImelJS

Don amfani da EmailJS, kuna buฦ™atar aiwatar da takamaiman matakai da snippets na lamba a cikin aikinku.

Da farko, shigo da tsarin ImelJS da aka shigar.

import emailjs from 'emailjs-com';

Bayan haka, saita ID ษ—in mai amfani na ImelJS ษ—in ku, wanda za'a iya samu daga dashboard ษ—in imelJS.

emailjs.init('YOUR_USER_ID');

Na gaba, kuna buฦ™atar aika imel. Aikin aika yana buฦ™atar ID ษ—in sabis, ID na samfuri, da sigogin samfuri waษ—anda aka cika cikin samfurin imel.

emailjs.send('YOUR_SERVICE_ID', 'YOUR_TEMPLATE_ID', 'YOUR_TEMPLATE_PARAMETERS')
    .then(function(response) {
       console.log('SUCCESS!', response.status, response.text);
    }, function(error) {
       console.log('FAILED...', error);
    });

Fahimtar lambar EmailJS

Misalin da ke sama code yana taimakawa saita EmailJS a cikin aikin JavaScript. Da fari dai, ana shigo da tsarin imelJS cikin aikin. Bayan wannan, an ฦ™addamar da tsarin imeljs tare da ID ษ—in mai amfani da aka samu daga dashboard ษ—in EmailJS. Matsakaicin amfanin EmailJS kawai za a iya ganowa da zarar kun cika ID ษ—in sabis da ya dace, ID na samfuri, da sigogin samfuri a cikin lambar ku.

Wannan tsarin, don haka, yana daidaita tsarin aika imel kai tsaye daga aikace-aikacen JavaScript. An yanke abin dogaro na gefen uwar garken, ta haka yana sauฦ™aฦ™a dukkan tsarin.

Ayyuka masu alaฦ™a da ษ—akunan karatu

Gine-gine na EmailJS ana goyan bayan ayyuka da ษ—akunan karatu da yawa. 'aikin aika', alal misali, wani muhimmin sashi ne na sabis na EmailJS. Alkawari da aka dawo daga aikin aika yana taimakawa musamman don lura da matsayin imel ษ—in da aka aiko.

Bugu da ฦ™ari, npm (Mai sarrafa fakitin Node) yana da mahimmanci don shigarwa da sarrafa ษ—akin karatu na EmailJS a cikin aikin JavaScript. Yana ba da damar ฦ™arawa mara wahala da sarrafa fakiti masu yawa kamar EmailJS a cikin aikin haษ“akawa.

A ฦ™arshe, EmailJS kayan aiki ne mai tasiri don aika imel kai tsaye daga lambar JavaScript. Wannan sassauฦ™an gine-gine da tsari na mataki-mataki suna sa EmailJS ya zama ingantaccen kayan aiki ga masu haษ“aka JavaScript.

Shafi posts:

Leave a Comment