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.