Does Laravel take care of the AWS SES 50 email address limit? - laravel

AWS SES guide:
Maximum number of recipients per message:
50 recipients per message. A recipient is any "To", "CC", or "BCC"
address.
Source: AWS SES Developer Guides
I'm currently using the following function:
Mail::send(['html' => 'emails.systemmail'],['mail' => $mail],
function($message) use ($emails){
$message->to($emails);
$message->subject('email subject');
});
Question: if the $emails array has more than 50 email addresses, what happens?
Does Laravel automatically send it in batches limited by 50?
Does SES automatically send it in batches limited by 50?
Are only the first 50 sent?
Are no emails sent and the SES server returns an error?
Do I need to array split and send it in batches of maximum 50 myself?
Bonus:
Is there any common/standard workaround?
What if there are 30 "To:" addresses and 30 "CC:" addresses?

Related

Is there a place to get more granular reporting data via API?

I'm trying to figure out a way to export some of the events I can see in the security dashboard and alert center. The Customer Reports API only gives me the # of mail received per day, and # or spam messages per day, but is more than 24 hrs behind.
I've tried to create an alert in the security alerts center for whenever my domain gets a relevant email, but I just get an email once a minute that says the the threshold was exceeded, and I have to click into the investigation tool to actually get the relevant data.
Is there a place I can request # of phishing emails per hour, or be alerted whenever new phishing emails are found. Or Malware, etc.
The Reports API method UserUsageReport: get allows you to retrieve received spam emails for a certain date by specifying the parameter gmail:num_spam_emails_received
However, if you want to retrieve e.g. the emails from the last hour, there is no prebuilt functionality for this.
You can write a Google Apps Script that would browse your Gmail Inbox for new Spam Emails and set the script on a time-driven trigger
Sample:
function setmeOnHourlyTimer() {
var now = new Date();
var oneHourAgoinSeconds = Math.round(now.getTime()/1000 - 1200 *60);
var query = '"after:'+ oneHourAgoinSeconds +'"';
var spamMessages = Gmail.Users.Messages.list("YOU_EMAIL", {"labelIds": ["SPAM"] , "q": query}).messages;
if (spamMessages.length > 0){
GmailApp.sendEmail("paste your email here", "You have new Spam emails", "You got " + spamMessages.length + " new spam message(s) within the last hour.")
}
}

How do I get a value out of ElasticSearch using a Kibana Watcher

Suppose that I have a dictionary of {"check_result": {"services": ['a','b','c'], "health": "red"}}. I send a Slack Notification when the number of messages with "health":"red" exceed 1 per minute using payload.hits.total. How do I pass the value in the key "services" to the Slack Message?

CPU is utilizing 100% resource and therefore Queue failed

My code is like below.
for($i = 0; $i <= 100; $i++) {
$objUser = [
"UserName" => $request["UserName"] . $i,
"EmailAddress" => $request["EmailAddress"] . $i,
"RoleID" => RoleEnum::ProjectManager,
"Password" => $request["Password"],
];
$RegisterResponse = $this->Register->Register($objUser);
$Data = $RegisterResponse["Data"];
$job = (new AccountActivationJob($Data));
dispatch($job);
}
Above code is creating 100 users and Each time a queue is being created to send email notification. I am using database default queue.
I have shared hosting account on GoDaddy. Due to some reasons the CPU usage reaches 100. Here is the screenshot.
Finally loop stops in between. Below is the screenshot after 5 mins.
Here, My problem is: It is not able to continue creating 100 users. I am doing this to test the sample queue implementation where multiple users send request for registration. Am I doing anything wrong?
As stated above, GoDaddy has a lot of resource limitations. You can only send 100 Emails an hour is what I have heard.
That also not at a single time. If it detects you are sending a lot of emails, your process is blocked.
Instead, you can queue up the messages to be sent 1 per 20 seconds or 30 seconds. It will help keep the resources in limits, and your emails are sent to the customers without any problem.
You can use the sleep function for this.
Godaddy does have a limit of resources you can use. If you go over it, it will kill the processes on ssh.
The limits are avaiable here
Try running the php process with a different nice parameter.
That's what I do when i need to use an artisan command that does use a lot of resources..
I did the findings and found that I should move to VPS instead of Shared hosting. here are the nice and cheap plans by GoDaddy. https://in.godaddy.com/hosting/vps-hosting

Invalid Alphanumeric 'From' address with Twilio SMS

I am trying to send an SMS with Twilio using the alphanumeric 'from' address. I'm in Australia, sending to an Australian mobile number. My cURL request looks like this:
curl -X POST 'https://api.twilio.com/2010-04-01/Accounts/<Account SID>/Messages.json' \
--data-urlencode 'To=+614XXXXXXXX' \
--data-urlencode 'From=Test' \
--data-urlencode 'Body=Test' \
-u <Account SID>:<Auth Token>
The response I am receiving is:
{
"code": 21212,
"message": "The 'From' number Test is not a valid phone number, shortcode, or alphanumeric sender ID.",
"more_info": "https://www.twilio.com/docs/errors/21212",
"status": 400
}
I've tried a number of different alphanumeric sender IDs and none have been successful. My sender ID does appear to meet the [a-zA-Z0-9 ] with max length 11 and at least 1 alpha character requirement. I've double checked my Account SID and Auth Token as well as the ability to send Alphanumeric SMS within Australia. I've also verified I'm not accidentally using my Test code incase that would have any effect. My account also does have credit on it.
Thanks in advance for any insight you can offer :)
Twilio developer evangelist here.
You're doing everything right for sending a message using an alphanumeric sender ID. However, in order to get your account setup for sending these messages you need to contact support and request your account is enabled to use alphanumeric sender IDs.
Let me know if that helps at all.

How to limit count of SMS sent by SMPPsim

I'm using SMPPsim to sent SMS to my task through it's MO Service.
I've put 15000 messages into deliver_messages.csv file, but SMPPsim sends them permanently.
Is there any way to limit count of SMS sent by SMPPsim?
As per SMPPSim there is no logic implemented to limit the count of messages.
For more details you can find classes called MoService.java ,MoMessagePool.java in SMPPSim source code .Smppsim simply fetching the values DELIVER_MESSAGES_FILE ,DELIVERY_MESSAGES_PER_MINUTE from smppsim.props and submitting respectively .

Resources