How to send email with the list of all people - Power Automate - email

There are some tutorials that explain how to email someone on their birthday. What I am looking for is to send a single email with the list of all the people who celebrate their birthday that day.
I would like to know how I can send in the body of the email the name of the people who celebrate their birthday on that day.
I have been working on a flow with each of the following steps:
Recurrence:
With this step I send my daily mail every certain hour.
Get items:
I created a sharepoint list where I have the name of the birthday boy, date of birthday (DOB), gender and department.
Initialize variable:
Apply to each
Append to string variable
I add to the Birthdays variable the value that would be the name of the employee whose birthday is that day that is in the sharepoint list
Send an email
In the step of sending an email, I add the previously initialized variable "Birthdays" to the body of the email, which should contain the list of employees whose birthday is that day
I have supported myself with this question made in the Microsoft Power Automate forum but it does not work as it should since I am new to power automate
Error:
At the moment of executing my manual flow I get in the condition as a result false in addition to two errors when I add the variable and send the mail
Can someone give me an orientation in knowing what I am doing wrong in the flow since my mail does not arrive either.
UPDATE:
The value of the Birthdays variable at runtime is as follows:
UPDATE 2:
I have added in Filter Query the following expression formatDateTime(utcNow(),'dd-MM-yyyy') eq 'listColumn' but when executing the manual flow I get that The expression "28-01-2022 eq 'listColumn'" does not It is valid.
Annex error that shows me in the execution of the manual test
UPDATE 3:
The column in the sharepoint list where I am storing the birthday date is called DOB:

Get Items action you should use Filter Query row to search something like: formatDateTime(utcNow(),'dd-MM-yyyy') eq 'listColumn'.(You should have a column in sharepoint containing all user birthdays).
[1]: https://i.stack.imgur.com/Y3s4S.png
Append to String all the emails that you get from GetItems: Email;

Try this one; it should work:
Birthdays eq '#{formatDateTime(utcNow(), 'yyyy-MM-dd')}'

Related

Snapchat API: Pull campaign stats for an add account, and must include campaign names

Looking trough Snapchat documentation, I couldn't find a way t pull the data with campaign name and only the data for last 7 days.
one of the parameters is start and end time (no way to just request last 7 days)
name is an existing field but only used to create a campaign.
if you try to use the field = name you will get an error
If somebody knows please advise.

Email Saved Search based on conditional field

I am looking to send an email from netsuite using the "Recipients from Results"
I already have a saved search that emails based on field "salesrep", however I want to send a 2nd report to "TAMS" (Territory adoption managers) but only if the TAM is not the same as the sales rep. I am not sure if I will need a workflow to do the comparison or if I need to just add a formula.
Any suggestions ??
None
How about a separate saved search that includes all of your original criteria and additional criteria that would leverage a formula field to say sales rep not equal to TAMS and then email the tams from results?
Formula definitely! DECODE({salesrep},<Yours TAMS field ID>,'Ignore','Email')

How to notify users their connected time to a course since begining

I want to know if there is a plugin or somehow to notify via email to moodle users if they have not connected since xxxx date to complete a course.
Is there a way to make this automatically via cron or so?
Thanks.
You're question is a 2 in 1. You're asking how to identify users who haven't signed on in a while, and how to email them. I'm going to answer in parts accordingly. All of this can be accomplished via cron, but I don't use Moodle so I don't know what plugins are available to you.
He's an example of a query that would identify users who haven't logged on in 180 days (but it will ignore those who have never logged in).
SELECT * FROM mdl_user
WHERE lastlogin < UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL 180 DAY))
AND lastlogin != 0
AND lastaccess < UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL 180 DAY))
AND deleted = 0
Now for the email bit. Per Google, Moodle uses the PHPMailer for it's email_to_user() function. An example of using this in PHP:
email_to_user($toUser, $fromUser, $subject, $messageText, $messageHtml, '', '', true);
$toUser and $fromUser should be Moodle user objects, not email addresses. Traversing your query results to build these objects would be all that's left to do.
Last tip: To get a user object based on each result of your query, you can use the get_record function like so:
$userObj = get_record("user", "id", $userID);

Grouping By with missing data

Image of Data and desired result:
I'm trying to aggregate volunteer hours from a Google spreadsheet a non-profit I volunteer for. We collect volunteer e-mail information and the time that each volunteer has contributed. Each volunteer only puts in their e-mail the first time. I've found examples online on how to send e-mails, but I'm having trouble aggregating the data. I think the trouble might be that not every row has an e-mail address associated with it.
I've been able to get the sum of hours worked by volunteer using QUERY(data, "select A, sum(C) Group By A", ) but can't figure out how to get the e-mail associated with each individual.
Thanks for the advice! The VLOOKUP and ArrayFormula functions were new to me. Here's how I solved it:
QUERY(data, "select A, B where B <>'' ", -1)
This allowed me to get the Key-Value pair (Name, Email) for each volunteer (solving the problem of people who volunteered multiple times, but only left their e-mail once). From there, I was able to generate the 'Name:Hours Worked' table off to the right with:
QUERY(data, "select A, sum(C) Group By A", ).
Then, I used VLOOKUP to query my Name-Email table to get the desired result of:
Name-Email-aggregatedHours
Thanks!
You can't achieve this with query. But you could apply vlookup to sorted table:
=ArrayFormula(VLOOKUP(UNIQUE(FILTER(A2:A,A2:A<>"")),SORT(A2:B,2,0),2,0))
and get email list for unique names.
First, clean up your data. You shoud be certain that at least one column has no typos an that this column appropiate identify which data corresponds to each volunteer. This is called key value. This also could be done by, but not limited to, filling up the missing values for each row. If this will be hard, then
Create a volunteer list without missing data.
Calculate the time contributed by each volunteer. If you was able to fill up the missing values, then you could use QUERY, I this case the QUERY formula should have to group by name and email, if not, then use SUMIF

Automated email sender using excel data

I would like an automated email sender for birthdays. This is what I would like to accomplish:
Check Today's Date
Find match in Column 'DOB'
If true, get data from corresponding columns 'Name' and 'Email' (Might have to use for each)
Create Outlook Email with Subject 'Happy Birthday'
Message text – Dear $Name, Happy Birthday!
Send Email
After a bit of research I understand I will have to use the Spreadsheet::WriteExcel and one of the Outlook modules (not sure which one).
get today's date with the help of system.getDate() after that fetch date of birth from database match both the date if matched send sms. for sending sms use mail.cs function and write body of mail.