Send mail from Mailhog to Gmail but gmail can't receive mail - email

I'm try to use api in mailhog
Get /api/v1/messages
[
{
"ID": "ZOif6IQhqZgViFi2HO4e8KBSJBAzlwwJ-92rCBccNU8=#mailhog.example",
"From": {
"Relays": null,
"Mailbox": "developer-send-mail",
"Domain": "gmail.com",
"Params": ""
},
"To": [
{
"Relays": null,
"Mailbox": "developer-recv-mail",
"Domain": "gmail.com",
"Params": ""
}
],
"Content": {
"Headers": {
"Message-ID": [
"ZOif6IQhqZgViFi2HO4e8KBSJBAzlwwJ-92rCBccNU8=#mailhog.example"
],
"Received": [
"from smtp.gmail.com by mailhog.example (MailHog)\r\n id ZOif6IQhqZgViFi2HO4e8KBSJBAzlwwJ-92rCBccNU8=#mailhog.example; Mon, 22 Nov 2021 18:30:16 +0000"
],
"Return-Path": [
"<developer-send-mail#gmail.com>"
]
},
"Body": "test my message\r\nnew1\r\nmulti line",
"Size": 33,
"MIME": null
},
"Created": "2021-11-22T18:30:16.822037969Z",
"MIME": null,
"Raw": {
"From": "developer-send-mail#gmail.com",
"To": [
"developer-recv-mail#gmail.com"
],
"Data": "test my nessaje\r\nnew1\r\nmulti line",
"Helo": "smtp.gmail.com"
}
},
]
and I
Post /api/v1/messages/ZOif6IQhqZgViFi2HO4e8KBSJBAzlwwJ-92rCBccNU8=#mailhog.example/release
Body
{
"Host": "smtp.gmail.com",
"Port": "587",
"Username": "developer-send-mail#gmail.com",
"Password": "MyMailPassword",
"Mechanism": "PLAIN",
"Email": "developer-send-mail#gmail.com"
}
Response code: 200
but in gmail developer-recv-mail#gmail.com can't receive this email

In your post value for release endpoint, you specify an Email value of developer-send-mail#gmail.com. Since this value is the recipient, I believe this should be developer-recv-mail#gmail.com from the sound of it?
https://github.com/mailhog/MailHog/blob/master/docs/APIv1.md#post-apiv1messages-message_id-release

Related

Can SendGrid webhook events include custom_args from personalizations?

I'm using a dynamic template in SendGrid to send transactional emails that typically go to multiple recipients in the personalizations field. The message body includes custom_args that are shared among all recipients, and in personalizations, both custom_args and dynamic_template_data specific to each recipient. Webhook events return the shared custom_args, but none of the recipient-specific custom_args. Is there a way to get events together with the personalized custom_args? Here's an example request body where we add a userId custom_arg for each recipient:
{
"from": {
"email": "sender#example.com",
"name": "Example Sender"
},
"personalizations": [
{
"to": [
{
"email": "recipient1#example.com",
"custom_args": {
"userId": "63r20acm4xfv"
}
}
],
"dynamic_template_data": {
"subject": "New Article",
"description": "Read the lastest news on...",
"documentId": "624dxnpvhw8g",
"host": "https://localhost:8000",
"userId": "63r20acm4xfv"
}
}
],
"custom_args": {
"documentId": "624dxnpvhw8g"
}
}
And the webhook events we receive (the "documentId" custom arg is reported, but not the "userID" custom_arg from personalizations):
[
{
"documentId": "624dxnpvhw8g",
"email": "recipient1#example.com",
"event": "processed",
"sg_event_id": "cHJvY2Vzc2VkLTI3MTk3NzMzLUtTUEJOaVpGUXpXb05KblctVDBNRkEtMA",
"sg_message_id": "KSPBNiZFQzWoNJnW-T0MFA.filterdrecv-58c58fcb9f-44vrp-1-6312139C-1F6.0",
"sg_template_id": "d-1ebc6b474b7041c0b439d1bdb17650e4",
"sg_template_name": "DEFAULT TEMPLATE",
"smtp-id": "<redacted>",
"timestamp": 1662128000
},
{
"documentId": "624dxnpvhw8g",
"email": "recipient1#example.com",
"event": "delivered",
"ip": "<redacted>",
"response": "250 Message received",
"sg_event_id": "ZGVsaXZlcmVkLTAtMjcxOTc3MzMtS1NQQk5pWkZReldvTkpuVy1UME1GQS0w",
"sg_message_id": "KSPBNiZFQzWoNJnW-T0MFA.filterdrecv-58c58fcb9f-44vrp-1-6312139C-1F6.0",
"sg_template_id": "d-1ebc6b474b7041c0b439d1bdb17650e4",
"sg_template_name": "DEFAULT TEMPLATE",
"smtp-id": "<redacted>",
"timestamp": 1662128002,
"tls": 1
}
]
Ugh - the custom_args in personalizations was at the wrong level. After moving the custom_args up to the same level as the dynamic_template_data, it worked fine and the values are included in the webhook events.
The example from the question was changed to:
{
"from": {
"email": "sender#example.com",
"name": "Example Sender"
},
"personalizations": [
{
"to": [
{
"email": "recipient1#example.com",
}
],
"custom_args": {
"userId": "63r20acm4xfv"
}
"dynamic_template_data": {
"subject": "New Article",
"description": "Read the lastest news on...",
"documentId": "624dxnpvhw8g",
"host": "https://localhost:8000",
"userId": "63r20acm4xfv"
}
}
],
"custom_args": {
"documentId": "624dxnpvhw8g"
}
}

How to send an email with variables using Mailjet API v3.1?

I just want to know why when I send variables using a template, the Mailjet API doesn't replace them, even the fakeFirstname doesn't show.
I just see {{var:FirstName:"fakeFirstName"}}
Here is my payload :
{
"Messages": [
{
"From": {
"Email": "senderEmail",
"Name": "senderName"
},
"To": [
{
"Email": "userEmail",
"Name": "userName"
}
],
"Subject": "subject",
"TextPart": "",
"HTMLPart": "",
"TemplateID": TemplateId,
"TemplateLanguage": true,
"Variables": {
"FirstName": "otherName"
}
}
]
}
Thanks for the helpers.

INTERNAL_SERVICE_ERROR on PayPal order pay

Question updated - more details added.
I get a 500 (INTERNAL_SERVICE_ERROR) error from PayPal when I try to pay for an order.
I get ok from create order, and get the orderID - order status CREATED.
The order is approved by buyer - successfully and order status become APPROVED.
Order created by https://api.sandbox.paypal.com/v1/checkout/orders
Approved using paypal https://www.paypalobjects.com/api/checkout.js
{
"id": "53T50821FM697283T",
"gross_total_amount": {
"value": "26.66",
"currency": "ILS"
},
"purchase_units": [
{
"reference_id": "20180318-64466",
"amount": {
"currency": "ILS",
"total": "26.66"
},
"payee": {
"email": "d0535318380-classeeks#gmail.com"
},
"items": [
{
"name": "Meeting",
"sku": "20180318-64466",
"description": "Meeting 1/26/2018 1:00 AM-1/26/2018 2:20 AM. aaaaa",
"price": "26.66",
"currency": "ILS",
"quantity": 1
}
],
"shipping_address": {
"recipient_name": "Andrey Dyachenko",
"line1": "ישראליס 5 דירה 4",
"city": "תל-אביב",
"country_code": "IL",
"postal_code": "61014",
"state": "",
"type": "HOME_OR_WORK"
},
"partner_fee_details": {
"receiver": {
"email": "d0535318380-reciver#gmail.com"
},
"amount": {
"value": "12.66",
"currency": "ILS"
}
}
}
],
"payer_info": {
"email": "d0535318380-buyer#gmail.com",
"first_name": "Andrey",
"last_name": "Dyachenko",
"payer_id": "BZDA9RCZXKYQY",
"country_code": "IL",
"shipping_address": {
"recipient_name": "Andrey Dyachenko",
"line1": "ישראליס 5 דירה 4",
"city": "תל-אביב",
"country_code": "IL",
"postal_code": "61014",
"state": "",
"type": "HOME_OR_WORK"
}
},
"metadata": {
"supplementary_data": [
{
"name": "risk_correlation_id",
"value": "53T50821FM697283T"
},
{
"name": "buyer_ipaddress",
"value": "109.65.134.129"
},
{
"name": "external_channel",
"value": "WEB"
}
]
},
"redirect_urls": {
"return_url": "https://classeeks.com/order/details/70368c93-90db-4a8e-bd82-6d611acc2d17",
"cancel_url": "https://classeeks.com/order/details/70368c93-90db-4a8e-bd82-6d611acc2d17"
},
"create_time": "2018-03-18T19:49:11Z",
"links": [
{
"href": "https://api.sandbox.paypal.com/v1/checkout/orders/53T50821FM697283T",
"rel": "self",
"method": "GET"
},
{
"href": "https://api.sandbox.paypal.com/v1/checkout/orders/53T50821FM697283T/capture",
"rel": "capture",
"method": "POST"
}
],
"status": "APPROVED"
}
Next step pay with https://api.sandbox.paypal.com/v1/checkout/orders/53T50821FM697283T/pay
{ "disbursement_mode":"DELAYED" }
Response
{
"name": "INTERNAL_SERVICE_ERROR",
"message": "The server encountered an internal error that prevented it from fulfilling this request.",
"information_link": "https://developer.paypal.com/docs/api/#INTERNAL_SERVICE_ERROR",
"debug_id": "be0c6976ab17a"
}
Based https://demo.paypal.com/us/demo/go?page=cart
If you have created the order successfully, then you can either capture the order directly or create the authorization which places the fund on hold and later you can capture the authorization. Check the doc for PayPal order APIs.

I need receive the messages created in response texts in some intentions of the API.AI

My issue:
I have two responses, but my chat return only one specified "the speech", but i need that return the two, like do the console of api
example of response JSON from API:
{
"id": "XXXXXXXXXXX",
"timestamp": "2017-07-12T20:08:48.101Z",
"lang": "es",
"result": {
"source": "agent",
"resolvedQuery": "Hello how are you?",
"action": "",
"actionIncomplete": false,
"parameters": {},
"contexts": [
{
"name": "intent",
"parameters": {},
"lifespan": 1
}
],
"metadata": {
"intentId": "XXXXXXXXXXXXXXXXXXXXXXXX",
"webhookUsed": "false",
"webhookForSlotFillingUsed": "false",
"intentName": "welcome"
},
"fulfillment": {
"speech": "Hello!",
"messages": [
{
"type": 0,
"speech": "Hello!"
},
{
"type": 0,
"speech": "Bye!"
}
]
},
"score": 1
},
"status": {
"code": 200,
"errorType": "success"
},
"sessionId": ""
}
I need show the black messages.

Domino 9.x calendar service create meeting

I have been following this guide to work on Domino 9.0.1
Domino Calendar services
I am using JSON and the POST command works but creates an appointment, what I want to do is create a meeting. I have tried setting other fields like event['x-lotus-appttype'].data or event.AppointmentType = 3 but I still get an appointment.
JSON I am sending
{
"events": [
{
"summary":"Meeting 1",
"location":"Location 1",
"start": {
"date":"2013-12-01",
"time":"13:00:00",
"utc":true
},
"end": {
"date":"2013-12-01",
"time":"14:00:00",
"utc":true
}
}
]
}
What is the correct JSON format to create a meeting ?
Take a look at the following documentation: Event with attendees represented in JSON format
EXAMPLE 4. Event with attendees and time zone array:
{
"x-lotus-charset": {
"data": "UTF-8"
},
"timezones": [
{
"tzid": "Eastern",
"standard": {
"start": {
"date": "1950-11-05",
"time": "02:00:00"
},
"offsetFrom": "-0400",
"offsetTo": "-0500",
"recurrenceRule": "FREQ=YEARLY;BYMONTH=11;BYDAY=1SU;BYHOUR=2;BYMINUTE=0"
},
"daylight": {
"start": {
"date": "1950-03-12",
"time": "02:00:00"
},
"offsetFrom": "-0500",
"offsetTo": "-0400",
"recurrenceRule": "FREQ=YEARLY;BYMONTH=3;BYDAY=2SU;BYHOUR=2;BYMINUTE=0"
}
}
],
"events": [
{
"href": "/mail/dlawson.nsf/api/calendar/events/DB7E0BAC21EC322A85257BD200756E26-Lotus_Notes_Generated",
"id": "DB7E0BAC21EC322A85257BD200756E26-Lotus_Notes_Generated",
"summary": "Staff meeting",
"location": "Ray's office",
"description": "Please email your status update 24 hours before the meeting.",
"start": {
"date": "2013-09-12",
"time": "09:00:00",
"tzid": "Eastern"
},
"end": {
"date": "2013-09-12",
"time": "10:00:00",
"tzid": "Eastern"
},
"class": "public",
"transparency": "opaque",
"sequence": 0,
"last-modified": "20130825T212457Z",
"attendees": [
{
"role": "chair",
"status": "accepted",
"rsvp": false,
"displayName": "Duke Lawson/Peaks",
"email": "DukeLawson#swg.usma.ibm.com"
},
{
"role": "req-participant",
"status": "needs-action",
"rsvp": true,
"displayName": "Dean Melnyk/Peaks",
"email": "DeanMelnyk#swg.usma.ibm.com"
},
{
"role": "req-participant",
"status": "needs-action",
"rsvp": true,
"displayName": "Raymond Chan/Peaks",
"email": "RaymondChan#swg.usma.ibm.com"
}
],
"organizer": {
"displayName": "Duke Lawson/Peaks",
"email": "DukeLawson#swg.usma.ibm.com"
},
"x-lotus-broadcast": {
"data": "FALSE"
},
"x-lotus-notesversion": {
"data": "2"
},
"x-lotus-appttype": {
"data": "3"
}
}
]
}
I hope this can help :)