I'm trying to send an email after our IPN sends payment status updates, and email customers as well. I have the following code
$file_attachement = null;
Mail::Send( (int)$email_order->id_lang,
'order_conf',
Mail::l('Order confirmation', (int)$email_order->id_lang),
null,
$email_customer->email,
$email_customer->firstname.' '.$email_customer->lastname,
null,
null,
$file_attachement,
null,
_PS_MAIL_DIR_, false, (int)$email_order->id_shop );
And I get the following error
Missing '$template' parameter...smarty_internal_templatebase.php on line 177
The order_conf exists, and I can look at the Advanced Parameters->Email and see that its trying to send.
Prestashop Version is 1.7.5.1
If you're using any theme, try to copy the email templates (for every lang), to the theme mail directory.
Mails are templated. You have to pass the data for the template mechanism.
Your data parameter is null.
<?php
$file_attachement = null;
Mail::Send(
(int)$email_order->id_lang,
'order_conf',
Mail::l('Order confirmation', (int)$email_order->id_lang),
$YOUR_DATA_ARRAY_NOT_NULL,
$email_customer->email,
$email_customer->firstname.' '.$email_customer->lastname,
null,
null,
$file_attachement,
null,
_PS_MAIL_DIR_, false, (int)$email_order->id_shop );
?>
You can get an idea of how to get these data from the source code of Prestashop
Related
I am trying to set up an emailing system for users on my website. I am using nextJS and have an api endpoint to send emails. To send the emails I am using emailJS and sending the email to myself with a custom body. Here is the code for my email.js file:
import { SMTPClient } from 'emailjs';
export default function handler(req, res) {
const {body, subject}=req.body;
// console.log(process.env)
const client = new SMTPClient({
user: "test#gmail.com",
password: "passward",
host: 'smtp.gmail.com',
ssl:true
});
try{
client.send(
{
text: `${body}`,
from: "test#gmail.com",
to: "test#gmail.com",
subject: `${subject}`,
}
)
}
catch (e) {
res.status(400).end(JSON.stringify({ message: e.message }))
return;
}
res.status(200).end(JSON.stringify({ message:'Mail sending' }))
}
The code works when I use it on localhost but it does not work when I deploy to amplify. When I try to make a post request on amplify I get status 200 with the {"message":"Mail sending"}. However, the gmail account never gets the email. I do not get an error message. I do not have 2 step verification on and have allowed less secure apps, but still no emails are being sent. I would really appreciate any help.
The emailjs library utilizes a queuing system for sending emails. This means that the send method adds the email to the queue and sends it at a later time. This can cause issues when using the send method within a lambda function, as the function may close before the email has been sent. To ensure that the email is sent before the lambda function closes, you can use the sendAsync method instead. This method returns a promise that will be resolved when the email has been successfully sent.
To send an email using the sendAsync method, you can do the following:
await client.sendAsync(
{
text: `${body}`,
from: "test#gmail.com",
to: "test#gmail.com",
subject: `${subject}`,
}
)
im New in .Net 5 and Blazor , im trying to make registration form with Identity , after i add the pages with scaffolding i want to add email confirmation i tried some example but not passed yet
https://dotnetcoretutorials.com/2017/11/02/using-mailkit-send-receive-email-asp-net-core/
please any idea or example to do this?
"EmailConfiguration": {
"SmtpServer": "smtp.gmail.com",
"SmtpPort": 465,
"SmtpUsername": "email#gmail.com",
"SmtpPassword": "password"}
I Solved my trouble with MailKit
https://jasonwatmore.com/post/2020/07/15/aspnet-core-3-send-emails-via-smtp-with-mailkit
important notes
to use Gmail as a sender enable Less secure app from email account setting
// create email message
var email = new MimeMessage();
email.From.Add(MailboxAddress.Parse("from_address#example.com"));
email.To.Add(MailboxAddress.Parse("to_address#example.com"));
email.Subject = "Test Email Subject";
email.Body = new TextPart(TextFormat.Plain) { Text = "Example Plain Text Message Body" };
// send email
using var smtp = new SmtpClient();
smtp.Connect("smtp.ethereal.email", 587, SecureSocketOptions.StartTls);
smtp.Authenticate("[USERNAME]", "[PASSWORD]");
smtp.Send(email);
smtp.Disconnect(true);
Recently I've started working with Facebook Conversion API to send events from serverside.
I'm using the test-event feature of the Facebook event-manager and when I set the email of the userData to a dummy value, it doesn't show up on the dashboard.
I've also tried removing the email and adding only the country ('US') and it doesn't show up either on the dashboard of the event-manager, test-event.
The data is like this:
{ "data": [ { "event_name": "subscriptionCreated", "event_time": 1612508965, "user_data": { "em": "f660ab912ec121d1b1e928a0bb4bc61b15f5ad44d5efdc4e1c92a25e99b8e44a" } } ], "partner_agent": null, "test_event_code": null, "namespace_id": null, "upload_id": null, "upload_tag": null, "upload_source": null, "access_token": "access-token", "id": "1361131684239273" }
Nevertheless, I'm not getting any error in the response either. It's a HTTP 200 with the following response.
{"events_received":1,"messages":[],"fbtrace_id":"AAAztL5vcQGb7v9bYZJ9QoP"}
Could anyone provide any clue into why these events aren't showing up in the dashboard ?
I have a validated domain, and sending a direct email via the AWS Pinpoint console works fine. However, I can't get the same to work with Boto3 send_messages.
I get {'DeliveryStatus': 'PERMANENT_FAILURE', 'StatusCode': 400, 'StatusMessage': 'Request must include message email message.'}
But I have a MessageConfiguration Default Message with a simple string for Body, and I've tried BodyOverride as well. No problems sending SMS.
I've been unable to snag an example of send_messages, and I think if I saw a working example of an email send, that'd be all I need.
Snippet:
response = ppClient.send_messages(
ApplicationId=pinpointId,
MessageRequest={
'Addresses': {
'mguard#{validateddomain}.com': {
# 'BodyOverride': 'Hello from Pinpoint!',
'ChannelType': 'EMAIL',
}
},
'MessageConfiguration': {
'DefaultMessage': {
'Body': 'Default Message for EMAIL.',
'Substitutions': {}
}
}
}
)
I have created a test API on Paypal
Do you know what i have to put in this function to make it work ?
// Creates a configuration array containing credentials and other required configuration parameters.
public static function getAcctAndConfig()
{
$config = array(
// Signature Credential
"acct1.UserName" => "",
"acct1.Password" => "",
"acct1.Signature" => "",
// Subject is optional and is required only in case of third party authorization
//"acct1.Subject" => "",
// Sample Certificate Credential
// "acct1.UserName" => "certuser_biz_api1.paypal.com",
// "acct1.Password" => "D6JNKKULHN3G5B8A",
// Certificate path relative to config folder or absolute path in file system
// "acct1.CertPath" => "cert_key.pem",
// "acct1.AppId" => "APP-80W284485P519543T"
);
return array_merge($config, self::getConfig());;
}
Thanks for your help...
Username is your email address
Password is likely the ClientID
Signature is likely the Secret
You should log into your Sandbox (the actual PayPal Sandbox site, not just Developer) account and verify that is the case