I created the following macro which:
- Opens Gmail in the browser
- It specifies the sender because I can send from several accounts
- It types the email address in the ‘To’ field
- It enters an subject for the email
- It types ‘Hi John, this is just a template’ in the body
- It sends the email by pressing CMD+ENTER
Problem
It’s not entering the text in the body
This is the HTML when the email is empty:
This is the HTML after I ran the macro:
This is the HTML when I type the text manually – right way to do it:
the following screenshot shows a different id (id=":vn") because I refreshed the page. don’t pay attention to the different id.
It looks like that <div dir="ltr">
is making the difference. Any way to fix it?
Macro
{
"Name": "Foro - Gmail",
"CreationDate": "2020-5-24",
"Commands": [
{
"Command": "bringBrowserToForeground",
"Target": "",
"Value": ""
},
{
"Command": "comment",
"Target": "open // https://mail.google.com/mail/u/0/#inbox?compose=new",
"Value": ""
},
{
"Command": "comment",
"Target": "waitForPageToLoad // ",
"Value": ""
},
{
"Command": "type",
"Target": "name=from",
"Value": "sender@domain.com"
},
{
"Command": "type",
"Target": "name=to",
"Value": "\"Test user\" <address@gmail.com>"
},
{
"Command": "type",
"Target": "name=subjectbox",
"Value": "Testing email subject"
},
{
"Command": "type",
"Target": "name=body",
"Value": "Hi John, this is just a template"
},
{
"Command": "XType",
"Target": "${KEY_CMD+KEY_ENTER}",
"Value": ""
}
]
}