Potential Duplicates Are Not Displayed - D365 Duplicate Detection Rule - duplicates

Create an email message with the same subject, recipient, and sender. Saved.
Create another email message with the same subject, recipient, and sender.
Scenarios Tested:
Emails are both owned by the user creating the records.
Emails are both owned by the team the user is a member of.
The security role added to the user/team has this
Result:
Duplicate Detection window pops out but the potential duplicate is not displayed.

Related

MailApp.sendEmail() not sending from current user

I have an onEdit triggered appscript that grabs data from a spreadsheet, formats it and then sends it to an email address. Typically these messages would be sent 'from' the user that is triggering the script to run. However, I am experiencing strange behavior where the current user is not used to send the message - or used inconsistently.
A couple of notes:
Occasionally the message is sent by the current user, other times it is not (in those cases it comes from my account, which created the script)
Script trigger is an 'onEdit' script which monitors the sheet for a checkbox status change
Spreadsheet is in a Shared Drive
We are using Google apps for education
The recipient address is a mailing list tool. When I list a different email address as the recipient (internal, external, other) the message consistently comes from the current user as expected. I've no idea why the recipient would affect how Google sends the message.
I realize i could use the GmailApp library to send instead, but want to avoid the re-authorizations that are mentioned.

How do I use the replyTo option parameter of replyAll()?

Scenario
Create a script that can send a email as per user selection on google spread sheet.
When user going to send email first time in a day must send a new email.
If going to send second time check subject line if already exists then must be replyAll to that email.
Attempted code
if (threads[0]) {
threads[0].replyAll(emailBody, {
// 'replyTo': emailAddress, (Removed due to issue with Gmail)
'cc': emailAddressCC,
'bcc': emailAddressBCC,
'htmlBody': emailBody
});
} else {
MailApp.sendEmail(emailAddress, subject, emailBody, {
// 'replyTo': emailAddress,
'cc': emailAddressCC,
'bcc': emailAddressBCC,
'htmlBody': emailBody
}
Link to full script: GitHub
This script creates a menu onOpen "Send Mail".
So, when user selects some area from sheet and click on "Send Mail" button it calls funShowAlert() and sends an email.
Issue
When I attempt to add the recipient's email to replyTo, gmail returns an error.
Question: Is it possible to use replyAll without the replyTo option parameter, and am I doing something wrong with replyTo ?
I am doing something wrong with replyTo ?
Yes.
Read the documentation carefully:
Reply to the sender (using the replyTo address),
The 'replyTo address' here is referring to the replyTo address in the email to which are you replying. It is made apparent that this is NOT the replyTo option parameter by the fact that there is no such parameter passed in the example immediately following it.
replyTo as a parameter option is defined in the next entry:
an email address to use as the default reply-to address (default: the user's email address)
'The user' here being the user the script is running as. This means that the replyTo option should be the address you would want the recipient to reply to. Normally when sending via Gmail's web UI, this must be a Gmail Alias associated with that account; although some testing with Apps Script indicates that is not necessarily the case.
Your code as is, with replyTo removed, is sufficient.

onEdit event object active user is returning my email address instead of the user doing the edit

I have a Google sheet with an installed trigger / app script. The script uses the event object (I call it e) to do various things. One thing I am trying is to get the email address of the user who is doing the editing of the Google sheets. So, if the event object is e, the e.user should return the user id / email address of the person logged into the Google sheet and performing the action. But, what it does instead do is return MY email address. I'm guessing the e.user id is the id of the user the app script is running under. Can any Google engineers chime in? How can I get the user id of the person doing the editing?
Ok, wow, I finally got this working, and that was a weird one. So, if the trigger is installable as opposed to simple, and the users doing the editing belong to my same domain, then the e.user should work. It wasn't. What I eventually figured out is when one of the shared collaborators opens up the apps script editor from the container, for some reason, everything started working. So, I'm now able to get the user id's and emails from all the users in my domain when they perform an action. It seems like this is a bug. I dunno. But it works now.
You can obtain the User's Email with e.user.getEmail();
Here's the documentation comment:
getEmail()
Gets the user's email address, if available. If security policies do not allow access to the user's email address, this method returns a blank string. The circumstances in which the email address is available vary: for example, the user's email address is not available in any context that allows a script to run without that user's authorization, like a simple onOpen(e) or onEdit(e) trigger, a custom function in Google Sheets, or a web app deployed to "execute as me" (that is, authorized by the developer instead of the user). However, these restrictions generally do not apply if the developer runs the script themselves or belongs to the same G Suite domain as the user.

Google script to forward email to recipient

While creating a rule in google admin I accidentally made a mistake and all the emails in my enterprise where sent to a specific email account. The emails skipped the inbox of the actual recipient and were sent to a global inbox.
Is there a script I can write to undo this meaning forwarding the email to the user who were suppose to receive this.

Google marks emails sent from spreadsheet with MailApp.sendEmail as phishing scam

I am using a variation of Google's MailApp.sendEmail() script ( https://developers.google.com/apps-script/articles/sending_emails) to send emails to addresses in a spreadsheet. To test the script I am sending them to another gmail account. However, the emails are being marked with the message: This message may not have been sent by: foo#gmail.com. Is there any way to avoid this? Thanks!
This warning isn't caused by the MailApp.sendMail() script. The phishing warning only shows up when I send email between two gmail accounts (both of which belong to me). It doesn't show up when I send email to other accounts using the MailApp.sendMail() script. The warning also appears when I send a standard gmail message from one account to the other, when the sending account is a consumer account, and the receiving account is a university account. The message does not appear on emails from other people's gmail addresses and does not appear on messages sent from my university account to my consumer account.