Resend से माइग्रेट करें
Resend से
OpenEmail पर आएँ।
Resend SDK को OpenEmail की ओर मोड़ें और अपना कोड रखें, या उसे OpenEmail SDK में कन्वर्ट करें। ऑडियंस, संपर्क, टेम्पलेट और वेबहुक एक कुंजी से आ जाते हैं।
वही ईमेल,
दोनों तरीक़ों से लिखा हुआ।
जवाब के लिए एक पते और एक टैग वाला एक संदेश, पहले Resend से भेजा गया और फिर OpenEmail से।
import { Resend } from 'resend'const resend = new Resend(process.env.RESEND_API_KEY)const { data, error } = await resend.emails.send({from: 'Acme <[email protected]>',to: ['[email protected]'],replyTo: '[email protected]',subject: 'Your invoice is ready',html: '<p>Thanks for your order.</p>',tags: [{ name: 'category', value: 'invoice' }],})if (error) {console.error(error.message)} else {console.log(data.id)}
import { init, openemail } from '@openemail/sdk'init({ apiKey: process.env.OPENEMAIL_API_KEY })try {const email = await openemail.emails.send({from: 'Acme <[email protected]>',to: ['[email protected]'],replyTo: '[email protected]',subject: 'Your invoice is ready',html: '<p>Thanks for your order.</p>',tags: { category: 'invoice' },})console.log(email.id)} catch (error) {console.error(error.message)}
फ़ील्ड-दर-फ़ील्ड,
क्या कहाँ जाता है।
Resend का हर विकल्प, और OpenEmail में उसकी जगह।
| Resend | OpenEmail | नोट्स |
|---|---|---|
from, to, cc, bcc, subject, html, text | from, to, cc, bcc, subject, html, text | वही नाम और वही मतलब। |
reply_to | replyTo | हर संदेश में एक पता। |
tags: [{ name, value }] | tags: { name: value } | अधिकतम 10 कुंजी-मान जोड़े। |
react | html | पहले कॉम्पोनेंट को HTML में रेंडर करें। |
attachments[].path | attachments[].content | फ़ाइल लाएँ और उसके बाइट्स दें। |
scheduled_at | scheduledAt | एक तारीख़, ISO समय या अवधि। |
Idempotency-Key | idempotencyKey | वही मतलब, अधिकतम 255 अक्षर। |
batch.send | emails.sendBatch | अधिकतम 100 ईमेल, हर एक अलग से भेजा जाता है। |
contacts.create({ audienceId }) | contacts.create({ audienceIds }) | नाम का एक फ़ील्ड, कई ऑडियंस। |
कन्वर्टर
अपना Resend कोड पेस्ट करें,
उसे OpenEmail पर वापस पाएँ।
चुनें कि कोड कहाँ से आता है और किस भाषा में है। पहचानी गई कुंजियाँ आपके ब्राउज़र में ही हटा दी जाती हैं, और आप जो भी पेस्ट करते हैं, वह रखा नहीं जाता।
Resend से आ रहे हैं?
बस दो लाइनें बदलें।
Resend SDK को OpenEmail की ओर मोड़ें और अपना कोड वैसा ही रखें, फिर संपर्क, टेम्पलेट और वेबहुक भी ले आएँ।
दो अंतर: एक संदेश में जवाब के लिए सिर्फ़ एक पता होता है, और content id से जुड़ी इनलाइन इमेज साधारण अटैचमेंट बनकर आती है।
RESEND_BASE_URL=https://api.openemail.uk/compat/resendRESEND_API_KEY=oe_live_…जवाब Resend के अपने ढाँचों और त्रुटि नामों में
बाकी सब एक कुंजी से ले आएँ
- ब्लॉक किए पते
- ऑडियंस
- संपर्क
- टेम्पलेट
- वेबहुक
बाकी सब लाइए
एक कुंजी से।
Resend की कुंजी डालिए, देखिए क्या-क्या है और इंपोर्ट शुरू कीजिए। डेटा आ जाता है, और डोमेन व कुंजियाँ चेकलिस्ट बनकर आती हैं, ताकि कुछ पीछे न छूटे।
Resend से आएँ
अपना सेटअप Resend से यहाँ ले आएँ।
RESEND_BASE_URL=https://api.openemail.uk/compat/resendRESEND_API_KEY=oe_live_…वेबहुक इवेंट,
नए नामों के साथ।
Resend का हर इवेंट और उसकी जगह लेने वाला OpenEmail इवेंट। हर अनुरोध में एक इवेंट होता है, हस्ताक्षर के साथ।
| Resend | OpenEmail |
|---|---|
email.sent | email.sent |
email.delivered | email.delivered |
email.delivery_delayed | email.delivery_delayed |
email.bounced | email.bounced |
email.complained | email.complained |
email.opened | email.opened |
email.clicked | email.clicked |
email.failed | email.failed |
Resend से आने के बारे में
सवालों के जवाब।
किसी और जगह से
आ रहे हैं?
हर गाइड में वही कन्वर्टर, फ़ील्ड मैप और चेकलिस्ट है।
कन्वर्ट हो गया?
वह कुंजी बनाएँ जिसे यह पढ़ता है।
वर्कस्पेस बनाने में एक मिनट लगता है। अपना डोमेन जोड़ें, एक API कुंजी बनाएँ और OPENEMAIL_API_KEY सेट करें।