Skip to content

Conversation

@arthur-pigeon
Copy link
Contributor

πŸ”— Linked issue

#105

❓ Type of change

  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

Brevo allow only one replyTo address as a object not a array object

Not valid:

curl -X POST "https://api.brevo.com/v3/smtp/email" \
-H "accept: application/json" \
-H "api-key: xkeysib-dunno" \
-H "Content-Type: application/json" \
-d '{
  "sender": {
    "name": "Sender Name",
    "email": "no-reply@yes.com"
  },
  "to": [
    {
      "email": "test@test.com",
      "name": "Recipient Name"
    }
  ],
  "replyTo": [{
    "email": "reply-me@yes.com",
    "name": "Reply To Name"
  }],
  "subject": "Your Subject Here",
  "htmlContent": "<html><body><p>Your email content here.</p></body></html>"
}'

Error: {"code":"invalid_parameter","message":"replyTo is not valid"}

If you don't pass a array but an object directly it works perfectly

❓ Type of change
 🐞 Bug fix (a non-breaking change that fixes an issue)
 πŸ‘Œ Enhancement (improving an existing functionality like performance)
 ✨ New feature (a non-breaking change that adds functionality)
 ⚠️ Breaking change (fix or feature that would cause existing functionality to change)
πŸ“š Description
Brevo allow only one replyTo address as a object not a array object

Not valid:

curl -X POST "https://api.brevo.com/v3/smtp/email" \
-H "accept: application/json" \
-H "api-key: xkeysib-dunno" \
-H "Content-Type: application/json" \
-d '{
  "sender": {
    "name": "Sender Name",
    "email": "no-reply@yes.com"
  },
  "to": [
    {
      "email": "test@test.com",
      "name": "Recipient Name"
    }
  ],
  "replyTo": [{
    "email": "reply-me@yes.com",
    "name": "Reply To Name"
  }],
  "subject": "Your Subject Here",
  "htmlContent": "<html><body><p>Your email content here.</p></body></html>"
}'
Error: {"code":"invalid_parameter","message":"replyTo is not valid"}

If you don't pass a array but an object directly it works perfectly

curl -X POST "https://api.brevo.com/v3/smtp/email" \
-H "accept: application/json" \
-H "api-key: xkeysib-dunno" \
-H "Content-Type: application/json" \
-d '{
  "sender": {
    "name": "Sender Name",
    "email": "no-reply@yes.com"
  },
  "to": [
    {
      "email": "test@test.com",
      "name": "Recipient Name"
    }
  ],
  "replyTo": {
    "email": "reply-me@yes.com",
    "name": "Reply To Name"
  },
  "subject": "Your Subject Here",
  "htmlContent": "<html><body><p>Your email content here.</p></body></html>"
}'

This is the exact same PR (almost) as #104

Brevo documentation here

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@arthur-pigeon
Copy link
Contributor Author

If approved, when would this be upstreamed ?

@thetutlage
Copy link
Member

Looks good to me!

@thetutlage thetutlage merged commit 99b1695 into adonisjs:develop Mar 20, 2025
1 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants