Send multi-line signature to Metamask via web3js - web3js

Checked all the similar questions suggested and couldn't find an answer, unfortunately.
Is there a way to send a multi-line message to metamask via web3.eth.personal.sign as the first parameter? (The problem is how to get multiple lines, not how to actually send a message there)
A more eloquent example of my question can be seen in the image attached. There are multiple paragraphs on separate lines: 'Welcome to OpenSea!', 'Click "Sign" to sign in..." etc.
Thanks a lot!

You can either use \n or use instead of '' or "" when you send the message. The option with takes the spacing in the content into consideration (in js).

Related

Follow https link from outlook message body with Azure Logic App

I have a task to follow first of two links which is contained in Outlook body and avoid second link.
Body example:
True link: http://metallica.com/
Link to avoid: https://black-star.ru/
I can only handle the message but then i don't know what to do.
Big thanks for any help!
Suppose you could use Contains to check whether the message has the link string. It will return true if the string is found.
contains(outputs('Compose'),'string')

Problems with sorting emails

I am wresting to sort email messages which I got using this api
https://developers.google.com/gmail/api/v1/reference/users/messages/list
Does anybody know how gmail api send this messages?
Do they send messages in order?
Thanks
Go to Users.messages.list and Execute the Try-it. You will notice that the threadIds of messages appear in descending order with the newest one appearing on top. Also confirmed in this SO post.
I recently looked into the same issue and wrote a short python prototype - feel free to take a look, it is publicly available on Github: https://github.com/jan-janssen/pygmailsorter
As #reyanthonyrenacia already pointed out the key part is using Users.messages.list, I then combine this with Users.messages.get to receive the full message and finally add or remove the label using the Users.messages.modify action.

SpelEvaluationException: EL1007E '#' not well managed when trying to develope a dialog answering with 'emails'

I'm writing a Dialog that identifies some required capabilities and provides as output the name and the email of the person having those capabilities.
I wrote a dialog node that provides an output like this: "The person you are looking for is name-surname and the email is xxxxx#yyyy.com" , but if I run it I receive the following error "SpelEvaluationException: EL1007E"
The error disappear when replacing the '#' in the answer with any other character
I also tried to build a context variable containing the email and building the answer using the variable but the error is the same.
Any suggestion?
Thanks
You need to escape the # by adding \\ so it should be x\\#y.com

mail clients stripping part of angular url

I am sending a signup activation email containing a signup confirmation url with a confirmation token that points to an angular front end app:
...
Activate
...
Note that the token is a JWT and is fairly long.
This works find for most users, but for some clicking on the link takes them to https://domain/com only without the confirm-signup?token=...
It seems as though the mail client may be stripping off everything after the #, but I can't find any evidence of others having this problem, nor can I reproduce it.
My best guess so far is that some mail clients are seeing the # and somehow treating the trailing part as an internal anchor and stripping it...?
Has anyone else encountered this sort of problem? If so, have you found any solution short of replacing the whole mechanism with something else?
Some clients treat the hash-link just fine. Others don't. There's a conversation about Outlook being dirty about this here: Outlook strips URL hash from email
What we did to resolve this at our company is simply create a handler on our server that redirects. Your email link would become http://domain.com/email-link?url=https%3A%2F%2Fdomain.com%2F%23%2Fconfirm-signup%3Ftoken%3D1234 and your server side script would grab the query param url and immediately trigger a redirect.
You'd need to make sure that you find all links in your emails and replace them. Here's a PHP function for that, but you could do this in whatever backend language you're using. Regex here may be helpful at least.
function replaceLinks($html,$hash) {
return preg_replace_callback('/<a [^>]*href=[\"\']{1}(.+?)[\"\\\']{1}/', function($matches) use ($hash) {
return str_replace($matches[1],"http://domain.com/email-link?url=".rawurlencode($matches[1]),$matches[0]);
}, $html);
}
Yes I have encountered this issue before because of the #, I was trying to link to a anchor on a landingpage.. My solution ended up using a short.url service to "hide" the # from the html e.g. https://goo.gl/
Looks like you need percent encoding!
A lot of times when your href gets parsed (by angular in this case) it doesn't handle the special characters right, or strips them. Find your problem characters and replace them with %3F for ?, %26 for &, and %23 for #. The rest are in a chart in the link.
Once the encoded address hits the browser the url will be decoded in your url bar.

cakephp2x email subject line length

I am trying to send an email using CakePHP 2x utility CakeEmail, I am getting all my values dynamically as below-
$Email = new CakeEmail();
$Email->from($from_id);
$Email->to($to_id);
$Email->subject($subject);
$Email->send($body);
Sometimes email is sending without any failure, but sometimes it wont. Finally I found the issue with the subject line length. Whenever my subject line is getting bigger then the email is not sending properly through programmatically. But, whenever my subject is line is less than nearly 75 characters then its working perfectly. So, how can I fix this issue by enlarging subject line length. Normally in gmail there is no restriction of subject length. But programmatically it is not allowing in CakePHP 2x CakeEmail utility.
Do you use SMTP. If not then please send mail using SMTP. and the check.
Please follow the given link bellow.
http://book.cakephp.org/2.0/en/core-utility-libraries/email.html
Got the solution by myself. Simply change the core behavior of Email functionality in Cake Lib. Open \lib\Cake\Network\Email\MailTransport.php and edit line no - 47 as below
$this->_mail($to, str_replace(array("\r","\n"), "", $email->subject()), $message, $headers, $params);
So, the basic change is to remove "New Line" & "Carriage Return" from Subject text. Whenever our subject text becomes more than 75 characters, framework will automatically put new line in the subject text, which wont work while on sending emails.

Resources