इसे छोड़कर कंटेंट पर जाएं

Email

अपने app से transactional emails भेजें। Dashboard > Emails या SDK से sender identities manage करें और delivery track करें।

हर Proyecta app transactional email भेज सकता है। एक sender identity verify करें, फिर अपने app code से email भेजें — किसी अलग email provider account की ज़रूरत नहीं।

Builder में Dashboard > Emails खोलें। इस tab में दो sub-tabs हैं:

Tabकिस काम के लिए
IdentitiesSender email addresses या domains add और verify करें
SentDelivery status के साथ भेजे गए emails देखें (sent, delivered, bounced, आदि)

आप बिना कोई code लिखे एक नई sender identity add कर सकते हैं और अपनी email delivery history देख सकते हैं।

  1. Sender identity बनाएं और verify करें (कोई email address या domain)
  2. proyecta.email.send() को from field में verified address के साथ call करें

सबसे आसान तरीका है किसी एक email address को verify करना।

import Proyecta from '@proyecta-ai/sdk';
const proyecta = new Proyecta({ apiKey: process.env.PROYECTA_API_KEY });
const identity = await proyecta.email.identities.create({
type: 'email',
value: 'hello@myapp.com',
});
// identity.status === 'verified' immediately upon creation

Verification check दोबारा trigger करने के लिए:

await proyecta.email.identities.verify({ identityId: identity.id });

Production apps के लिए, पूरा domain verify करें ताकि आप उस domain पर किसी भी address से भेज सकें (hello@, support@, noreply@, आदि)।

const identity = await proyecta.email.identities.create({
type: 'domain',
value: 'myapp.com',
});
// identity.status === 'verified' immediately upon creation

DNS-based domain verification (SPF/DKIM record generation और recheck) planned है लेकिन अभी implement नहीं हुई है।

एक बार आपकी identity verify हो जाए, इस तरह भेजें:

await proyecta.email.send({
from: 'Acme <hello@myapp.com>',
to: 'customer@example.com',
subject: 'Your receipt from Acme',
html: '<p>Thanks for your order — here are the details.</p>',
text: 'Thanks for your order — here are the details.',
});

send पूरा sent email object return करता है (जिसमें id, last_event, और message fields शामिल हैं), जिसे आप बाद में delivery status देखने के लिए use कर सकते हैं।

Recipients. to, cc, और bcc सभी एक single address या एक array स्वीकार करते हैं।

Content. html, text, या दोनों provide करें। बेहतर deliverability के लिए plain-text version ज़रूर शामिल करें।

Reply-to, custom headers, metadata tags. reply_to supported है (पहला address use होता है)। Custom headers और metadata tags API द्वारा accept किए जाते हैं लेकिन अभी delivery provider को forward नहीं किए जाते।

भेजे गए emails को उनके latest delivery event के साथ list करें (paginated):

const { data: emails } = await proyecta.email.list({ limit: 20 });
for (const email of emails) {
console.log(email.subject, '', email.last_event);
// last_event: 'sent' | 'delivered' | 'opened' | 'clicked' | 'bounced' | 'complained'
}

किसी single email को उसके पूरे HTML/text body के साथ fetch करें:

const full = await proyecta.email.get('email_abc123');
console.log(full.html, full.text, full.last_event);

AI से करवाएं यह काम

Section titled “AI से करवाएं यह काम”

यह सब खुद लिखने की ज़रूरत नहीं:

  • "Verify hello@myapp.com as a sending identity."
  • "Send a welcome email with Proyecta Email whenever a new user signs up. Use a nice HTML template."
  • "After a successful checkout, send the customer a receipt using proyecta.email.send."
  • "Show me the last 20 emails we've sent and whether they bounced."

ध्यान देने योग्य बातें

Section titled “ध्यान देने योग्य बातें”
  • from address एक verified identity होना चाहिए। बिना verified address से भेजने पर error आता है।
  • Monthly limits लागू होती हैं जो आपके Proyecta plan पर निर्भर करती हैं।
  • Template editor — builder में visually transactional templates design करें
  • Bulk/batch send endpoint mass mailings के लिए