---
name: restaurant-email-sender
description: Send restaurant information and website details via email using Resend API and Make (Integromat) integration. Use after creating a restaurant website to notify stakeholders, send confirmation emails, or distribute restaurant details to subscribers. Handles email templating, Resend API integration, and Make workflow automation.
---

# Restaurant Email Sender

Send restaurant information, website URLs, and details via email using Resend API integrated with Make (Integromat) workflows.

## Overview

This skill complements the restaurant-website-builder by providing email notification capabilities. After a restaurant website is created and deployed, use this skill to:

- Send website launch notifications to restaurant owners
- Email restaurant details to marketing teams
- Distribute menu information to subscribers
- Send confirmation emails with reservation details
- Notify stakeholders about new restaurant listings

## Prerequisites

1. **Resend Account**: Sign up at https://resend.com/
   - Get your API key from the dashboard
   - Verify your domain or use the default Resend domain for testing

2. **Make (Integromat) Account**: Sign up at https://www.make.com/
   - Create a new scenario for email automation
   - Set up webhook triggers

## Workflow

### 1. Set Up Resend Integration

**Option A: Direct API Usage**
Use the Resend API directly with the API key:

```bash
curl -X POST 'https://api.resend.com/emails' 
  -H 'Authorization: Bearer re_xxxxxxxx' 
  -H 'Content-Type: application/json' 
  -d '{
    "from": "Restaurant Team <onboarding@resend.dev>",
    "to": ["owner@restaurant.com"],
    "subject": "Your Restaurant Website is Live!",
    "html": "<strong>Your website is ready</strong><p>URL: https://your-restaurant.vercel.app</p>"
  }'
```

**Option B: Via Make (Integromat) Webhook**
Send data to a Make webhook that triggers the email:

```bash
curl -X POST 'https://hook.make.com/xxxxxxxx' 
  -H 'Content-Type: application/json' 
  -d '{
    "restaurant_name": "Tony's Pizza",
    "website_url": "https://tonys-pizza.vercel.app",
    "recipient_email": "owner@restaurant.com",
    "template": "website_launch"
  }'
```

### 2. Make Scenario Setup

**Step 1: Create Webhook Trigger**
1. In Make, create a new scenario
2. Add "Webhooks" module → "Custom webhook"
3. Copy the webhook URL
4. Configure expected JSON structure

**Step 2: Add Resend Module**
1. Add "Resend" module → "Send an Email"
2. Connect your Resend account (add API key)
3. Map fields from webhook data:
   - From: Your verified sender
   - To: `{{ webhook.recipient_email }}`
   - Subject: Dynamic based on template
   - HTML Body: Use HTML template with variables

**Step 3: Add Router (Optional)**
For multiple email types, add a router:
- Website launch notification
- Menu update alert
- Reservation confirmation
- Weekly newsletter

### 3. Email Templates

Create HTML templates for different email types:

**Website Launch Template:**
```html
<!DOCTYPE html>
<html>
<head>
  <style>
    body { font-family: Arial, sans-serif; line-height: 1.6; }
    .container { max-width: 600px; margin: 0 auto; padding: 20px; }
    .header { background: #f4f4f4; padding: 20px; text-align: center; }
    .content { padding: 20px; }
    .button { background: #007bff; color: white; padding: 12px 24px; text-decoration: none; border-radius: 5px; display: inline-block; }
  </style>
</head>
<body>
  <div class="container">
    <div class="header">
      <h1>🎉 {{restaurant_name}} Website is Live!</h1>
    </div>
    <div class="content">
      <p>Hello {{recipient_name}},</p>
      <p>Great news! Your restaurant website has been successfully created and deployed.</p>
      
      <h3>Website Details:</h3>
      <ul>
        <li><strong>Restaurant:</strong> {{restaurant_name}}</li>
        <li><strong>Website URL:</strong> <a href="{{website_url}}">{{website_url}}</a></li>
        <li><strong>Cuisine:</strong> {{cuisine_type}}</li>
        <li><strong>Location:</strong> {{address}}</li>
      </ul>
      
      <p style="text-align: center; margin: 30px 0;">
        <a href="{{website_url}}" class="button">View Your Website</a>
      </p>
      
      <p>If you have any questions or need updates, feel free to reply to this email.</p>
      <p>Best regards,<br>Restaurant Website Team</p>
    </div>
  </div>
</body>
</html>
```

**Restaurant Info Template:**
```html
<!DOCTYPE html>
<html>
<head>
  <style>
    body { font-family: Arial, sans-serif; }
    .restaurant-card { border: 1px solid #ddd; padding: 20px; margin: 10px 0; border-radius: 8px; }
    .info-row { margin: 10px 0; }
    .label { font-weight: bold; color: #555; }
  </style>
</head>
<body>
  <div class="restaurant-card">
    <h2>{{restaurant_name}}</h2>
    <div class="info-row"><span class="label">Cuisine:</span> {{cuisine_type}}</div>
    <div class="info-row"><span class="label">Address:</span> {{address}}</div>
    <div class="info-row"><span class="label">Phone:</span> {{phone}}</div>
    <div class="info-row"><span class="label">Hours:</span> {{hours}}</div>
    <div class="info-row"><span class="label">Website:</span> <a href="{{website_url}}">{{website_url}}</a></div>
    <p>{{description}}</p>
  </div>
</body>
</html>
```

### 4. Integration Script

Use the provided script to send emails via the Make webhook:

```bash
./scripts/send_restaurant_email.sh 
  --webhook "https://hook.make.com/xxxxxxxx" 
  --template "website_launch" 
  --name "Tony's Pizza" 
  --url "https://tonys-pizza.vercel.app" 
  --to "owner@restaurant.com"
```

Script parameters:
- `--webhook` - Make webhook URL
- `--template` - Email template type (website_launch, restaurant_info, menu_update)
- `--name` - Restaurant name
- `--url` - Website URL
- `--to` - Recipient email address
- `--cuisine` - Cuisine type (optional)
- `--address` - Restaurant address (optional)
- `--phone` - Phone number (optional)
- `--hours` - Operating hours (optional)

### 5. Batch Email Sending

For multiple recipients, use the batch script:

```bash
./scripts/batch_send_emails.sh 
  --webhook "https://hook.make.com/xxxxxxxx" 
  --csv "recipients.csv" 
  --template "newsletter"
```

CSV format:
```csv
email,name,restaurant_name,website_url
owner1@restaurant.com,John,Tony's Pizza,https://tonys-pizza.vercel.app
owner2@restaurant.com,Jane,Mario's Trattoria,https://marios-trattoria.vercel.app
```

## Environment Variables

Store sensitive configuration in `.env`:

```bash
# Resend Configuration
RESEND_API_KEY=re_xxxxxxxx
RESEND_FROM_EMAIL=notifications@yourdomain.com
RESEND_FROM_NAME=Restaurant Website Team

# Make Webhook URLs
MAKE_WEBHOOK_LAUNCH=https://hook.make.com/xxxx_launch
MAKE_WEBHOOK_INFO=https://hook.make.com/xxxx_info
MAKE_WEBHOOK_MENU=https://hook.make.com/xxxx_menu
```

## Error Handling

- **Invalid email address**: Make will return error; check email format
- **Resend API limits**: Free tier: 100 emails/day; Pro: 50,000/month
- **Webhook failures**: Check Make scenario execution history
- **Template errors**: Validate HTML before sending

## Security Notes

- Never commit API keys to git
- Use environment variables for sensitive data
- Verify domain in Resend before sending to external recipients
- Use Resend's test domain for development

## Example Usage Flow

1. **Website Created**: User says "Create a website for Tony's Pizza"
2. **Deploy Complete**: Website deployed to https://tonys-pizza.vercel.app
3. **Send Notification**: Use this skill to email the owner:
   ```
   Sending website launch email to owner@tonyspizza.com...
   ✓ Email sent successfully via Resend
   ✓ Make scenario executed
   ```

## Integration with Restaurant Website Builder

After completing the 6-step website builder workflow:

1. Get the deployed website URL from Vercel
2. Collect restaurant owner email from search results or user input
3. Trigger the email sender skill with website details
4. Confirm email delivery to the user

## Make Scenario Templates

**Basic Scenario (Webhook → Resend):**
```
[Webhook] → [Resend: Send Email] → [Gmail: Save Copy (optional)]
```

**Advanced Scenario (with conditions):**
```
[Webhook] → [Router]
           ├─→ [Filter: template=launch] → [Resend: Launch Template]
           ├─→ [Filter: template=info] → [Resend: Info Template]
           └─→ [Filter: template=menu] → [Resend: Menu Template]
```

**Scenario with Database:**
```
[Webhook] → [Google Sheets: Add Row] → [Resend: Send Email] → [Slack: Notify Channel]
```

## Testing

1. **Test with Resend test domain:**
   - Use `onboarding@resend.dev` as sender
   - Send to your own email first

2. **Test Make webhook:**
   - Use webhook.site for initial testing
   - Verify data payload structure

3. **Verify email delivery:**
   - Check spam folders
   - Validate HTML rendering
   - Test on mobile devices
