Skip to content

[Mailer] Add new attributes to Infobip API transport #49491

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 5, 2023

Conversation

ndousson
Copy link
Contributor

@ndousson ndousson commented Feb 22, 2023

Q A
Branch? 6.3
Bug fix? no
New feature? yes
Deprecations? no
Tickets N/A
License MIT
Doc PR N/A

📍 Context

Infobip has a mechanism to send back SMS status like webhook do.

To do that, we need to add some attributes to the payload.

This MR aim to add this attributes.

It's a need for our company so I hope this new "feature" will be supported by the transport.

➕ New feature

New payload attributes was added allowing end users to use the reporting.

Attribute Type Description
X-Infobip-IntermediateReport boolean The real-time Intermediate delivery report that will be sent on your callback server.
X-Infobip-NotifyUrl string The URL on your callback server on which the Delivery report will be sent.
X-Infobip-NotifyContentType string Preferred Delivery report content type. Can be application/json or application/xml.
X-Infobip-MessageId string The ID that uniquely identifies the message sent to a recipient.

ℹ️ Note that no one of this attributes are required.

@carsonbot carsonbot added this to the 6.3 milestone Feb 22, 2023
@nicolas-grekas nicolas-grekas self-assigned this Feb 22, 2023
@carsonbot carsonbot changed the title Add new attributes to Infobip API transport [Mailer] Add new attributes to Infobip API transport Feb 22, 2023
@ndousson ndousson force-pushed the implement_infobip_reporting_behavior branch from 9cf1959 to 2ade00d Compare February 22, 2023 15:25
6.3
---

* Add infobip reporting behavior thanks to new attributes support
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Add infobip reporting behavior thanks to new attributes support
* Add reporting behavior thanks to new attributes support

@ndousson ndousson force-pushed the implement_infobip_reporting_behavior branch from 2ade00d to 5a20137 Compare February 27, 2023 07:29
@@ -123,6 +123,24 @@ private function formDataPart(Email $email, Envelope $envelope): FormDataPart

$this->attachmentsFormData($fields, $email);

$headers = $email->getHeaders();

if ($headers->has('intermediateReport')) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that all custom headers specific to a provider should be prefixed with something like X-Infobip-.

It will prevent collision with other providers that may use the same custom headers.

You can look at other provider code 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this feedback. I reworked the code to use the same behavior as Mailjet and I think it's better.

I tried it too in real condition in our projet and it works as expected.

@ndousson ndousson force-pushed the implement_infobip_reporting_behavior branch 2 times, most recently from bb9164d to 469a10c Compare March 2, 2023 08:38
@ndousson ndousson force-pushed the implement_infobip_reporting_behavior branch from 03cab3d to 4d7facd Compare April 4, 2023 15:05
@fabpot
Copy link
Member

fabpot commented Apr 5, 2023

Thank you @ndousson.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants