Getting Started
Getting Started
Welcome to SendinCraft! This guide will help you send your first transactional email in under 5 minutes.
Prerequisites
Before you begin, you'll need:
- A SendinCraft account (sign up here)
- A verified email address
- A domain you want to send emails from
Step 1: Create Your Account
- Visit sendincraft.com and click "Sign Up"
- Enter your email address and create a password
- Verify your email address by clicking the link we send you
You'll receive a welcome email with your account confirmation and next steps.
Step 2: Verify Your Sending Domain
To send emails from your domain, you need to verify ownership:
Add DNS Records
Add these DNS records to your domain:
# SPF Record (TXT)
Name: @
Value: v=spf1 include:amazonses.com ~all
# DKIM Records (CNAME)
Name: _domainkey.yourdomain.com
Value: _domainkey.amazonses.com
# DMARC Record (TXT)
Name: _dmarc
Value: v=DMARC1; p=quarantine; rua=mailto:dmarc@yourdomain.com
DNS propagation can take up to 48 hours. We'll notify you once verification is complete.
Verify in Dashboard
- Go to your SendinCraft Dashboard
- Click "Add Domain"
- Enter your domain name
- Follow the DNS setup instructions
- Click "Verify Domain"
Step 3: Get Your API Keys
- Navigate to API Keys in your dashboard
- Click "Create New API Key"
- Give it a descriptive name (e.g., "Production API Key")
- Copy and securely store your API key
Keep your API keys secure! Never commit them to version control or share them publicly.
Step 4: Install the SDK
Choose your preferred programming language:
npm install @sendincraft/node
pip install sendincraft
composer require sendincraft/sendincraft-php
gem install sendincraft
Step 5: Send Your First Email
import { SendinCraft } from '@sendincraft/node';
const client = new SendinCraft(process.env.SENDINCRAFT_API_KEY);
async function sendWelcomeEmail() {
try {
const result = await client.emails.send({
from: 'welcome@yourdomain.com',
to: 'user@example.com',
subject: 'Welcome to our platform!',
html: `
<h1>Welcome!</h1>
<p>Thanks for signing up. We're excited to have you on board!</p>
<a href="https://yourdomain.com/dashboard">Get Started</a>
`,
text: 'Welcome! Thanks for signing up. Visit https://yourdomain.com/dashboard to get started.'
});
console.log('Email sent successfully:', result.id);
} catch (error) {
console.error('Failed to send email:', error);
}
}
sendWelcomeEmail();
import os
from sendincraft import SendinCraft
client = SendinCraft(api_key=os.getenv('SENDINCRAFT_API_KEY'))
def send_welcome_email():
try:
result = client.emails.send(
from_email='welcome@yourdomain.com',
to='user@example.com',
subject='Welcome to our platform!',
html='''
<h1>Welcome!</h1>
<p>Thanks for signing up. We're excited to have you on board!</p>
<a href="https://yourdomain.com/dashboard">Get Started</a>
''',
text='Welcome! Thanks for signing up. Visit https://yourdomain.com/dashboard to get started.'
)
print(f'Email sent successfully: {result.id}')
except Exception as error:
print(f'Failed to send email: {error}')
send_welcome_email()
curl -X POST https://api.sendincraft.com/v1/emails \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"from": "welcome@yourdomain.com",
"to": "user@example.com",
"subject": "Welcome to our platform!",
"html": "<h1>Welcome!</h1><p>Thanks for signing up!</p>",
"text": "Welcome! Thanks for signing up."
}'
Step 6: Check Email Status
Monitor your email delivery:
// Get email status
const email = await client.emails.get('email_id_here');
console.log('Email status:', email.status);
// List recent emails
const emails = await client.emails.list({ limit: 10 });
emails.data.forEach(email => {
console.log(`${email.id}: ${email.status}`);
});
Environment Variables
For security, store your API key as an environment variable:
# .env file
SENDINCRAFT_API_KEY=your_api_key_here
Best Practice: Use different API keys for development, staging, and production environments.
Next Steps
Now that you've sent your first email, explore these features:
- Email Templates - Use pre-built templates or create custom ones
- Webhooks - Receive real-time delivery notifications
- Analytics - Track email performance and engagement
- API Reference - Explore all available endpoints
Troubleshooting
Common Issues
Domain not verified?
- Check that DNS records are correctly added
- Wait up to 48 hours for DNS propagation
- Contact support if issues persist
API key not working?
- Ensure you're using the correct API key
- Check that the key hasn't been revoked
- Verify you're using the right environment (test/live)
Emails not delivering?
- Check your sender reputation
- Verify recipient email addresses
- Review bounce and complaint rates
Need help? Contact our support team at support@sendincraft.com