Sending to another user with e-mail address - coinbase-api

I am trying to create a script in Python to transfer funds to another Coinbase user when all I have is an e-mail address. I have been unsuccessful so far. How do I get another user's "id" when all I have is their e-mail address?
As a follow on, can I add a memo/note to the transfer? If so, how?

Finally figured it out with a little bit more searching and trial and error. For anyone else who may have this question:
First get the account ID for the currency you want to send.
account_list = client.get_accounts()['data']
ETH_id = [acc['id'] for acc in account_list if acc['balance']['currency'] == "ETH"][0]
Then use the send_money function (not transfer_money) to send to an e-mail address.
client.send_money(ETH_id,to="<e-mail address>", amount="0.0005", currency="ETH", description = "Hey look, it worked.")
The description keyword is for the memo.

Related

Sending emails to multiple users using flows(Salesforce)

I need to send an email notification to the record owner and manager once the opportunity is closed-won.
adding only owner email works fine
adding only manager email works fine
But if I add both together with coma, {!$Record.Owner.Email},{!$Record.Engagement_Manager__r.Email} I'm getting error.
what is the correct way to add it?
You can try creating a Formula Resource in your flow like this but, in your case, using $Record.Owner.Email and $Record.Engagement_Manager__r.Email:
Then, you can use this Resource in your Email Action:
Try the below code and let me know if it works.
global class SendPurchaseOrderEmail {
WebService static void sendEmail(String poId) {
List<Messaging.SingleEmailMessage> emails = new List<Messaging.SingleEmailMessage>();
String theTemplate = [SELECT Id FROM EmailTemplate WHERE DeveloperName = 'Purchase_Order_With_Items'].Id;
User theUser = [SELECT Id FROM User WHERE Name = 'user name goes here'];
Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
mail.setSaveAsActivity(false);
mail.setTemplateId(theTemplate);
mail.setWhatId(poId);
mail.setTargetObjectId(theUser.Id);
mail.setToAddresses(new String[] { 'TestUser#salesforce.com' ,'abc#test.com'}); //add other emails here.
emails.add(mail);
Messaging.sendEmail(emails);
}
}
Please refer below link for more details.
https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_calls_sendemail.htm
This is because you have to pass a direct email address there.
Instead of that, you can create a collection variable, store the emails into it, then pass that variable to email addresses (collection) field.
Note: you can only store upto 5 emails into that colllection variable at a time.
Hi For that you can simply add collection Variable.
For that variable assign multiple values to it. So that you can send email to both record owner as well as manager.
From New Resource Select the Variable and click Allow Multiple Values and Data-type as text.
Then by using Assignment. Add the following email Address to it Please refer the below image.
I hope you have got the solution
Thanks

Change Recipient Address Google Apps Script

Is it possible to change the recipient address when using the reply function in Google Apps Script?
I want to receive an email from a random email account, mark it with a label and when scheduled, run the following code to reply to a desired email address rather than the original sender. The reason I want to reply is to keep it in the same thread. I have tried nearly all variations of the following code and can't get it to work the way I want it to:
thread.reply("This is a message.", {
htmlBody: "This is a message.",
name: "My Name",
recipient: "DESIRED#EMAIL.com",
replyTo: "DESIRED#EMAIL.com",
to: "DESIRED#EMAIL.com"
});
If you're asking to generate a random email address and send a real email from that address... that's not possible.
However... you could set the replyTo optional parameter as a random address - though when users would try to reply to that thread they would get a bounce-back notification that the address could not be reached. However, the original sender (the non-random address) would still be visible in the original message.
If you look at the GmailApp docs (replying)/(sending), you'll notice a few limitations. The sender's address (from) must be a valid Alias, if you're sending mail from MailApp (Google Apps Script).
However, there are plenty of methods in the GmailMessage class such as getFrom() and getReplyTo() that would allow you to get/set the message's from/replyTo parameters and have them be the same value. That way, when you reply to a message you will always be in the same thread.

Target email address validiation

Before the client sends a new email, he/she specifies one or more (To) destination addresses. Is there any way to check the validity of these emails before sending the message ?
Define "validity".
This JavaMail FAQ entry might help.
The InternetAddress class only checks the syntax of the address. The InternetAddress class is not able to determine whether the address actually exists as a legal address. It is not even possible to verify the host name if the application is running behind a firewall or isn't currently connected to the Internet.

multiple mail recipients with CakePHP using bcc (the right insert method)

i use the php framework cakePHP to create a web app. There,i want the user to insert in a field as many email addresses as he desires and by hitting the Send button,a message would be emailed to all of the emails.
To achieve that,i have to use bcc.
My problem is that i do not know how can i "read" from the user his email addresses in the right form so that i use them in bcc.
Till now,i have a variable $to = $this->request->data['Mail']['to']; ,where 'Mail' is my model name,and in case the user inserts just one email address,the recipient receives the mail correctly. But how can i enable it to receive multiple email addresses (maybe in an array??) so that i use the variable $to at this piece of code:
$Email = new CakeEmail();
$Email->from($from)
->**bcc($to)**
->subject($subject)
->send($message);
and help is welcomed :)
thank you in advance!
There is the API ( http://api.cakephp.org/2.3/class-CakeEmail.html#_addBcc ) and the code is open source. They all provide the information you are looking for.
If you open the class CakeEmail you will find ( https://github.com/cakephp/cakephp/blob/master/lib/Cake/Network/Email/CakeEmail.php#L482 ):
public function addBcc()
which is different from bcc() since it can be used multiple times to add multiple bcc addresses.

How do I send email from Google App Engine with a random, non-app admin sender?

Google App Engine has a rule of only allowing app admins to send email.
Is there a workaround that anyone out there is using to send emails from non-admin addresses?
I'm building a B2B white-label platform, and being able to mask the "FROM" address is very important without giving my customers admin access.
The docs also state:
Any valid email receiving address for the app (such as xxx#APP-ID.appspotmail.com).
So you can make up an sender address based on that, and even correctly route that email back into your app if anyone replies to it.
It is also possible to send email on behalf of a logged in user, assuming that user is using a Google Account.
user = users.get_current_user()
message = mail.EmailMessage(sender=user.email())
#Set other message components, such as message.body
try:
message.send()
except:
message.sender = #An APP-ID.appspotmail.com address, or Admin address
message.send()
If you need the email to appear as if it was sent by a user and when replied to reply back to that user's actual email address then you can make use of reply_to.
user_name = 'Some Guy'
user_email = 'some.guy#whatever.com'
admin_email = 'no-reply#yourdomain.com'
from_email = '%s <%s>' % (user_name, admin_email)
reply_to = '%s <%s>' % (user_name, user_email)
mail.send_mail(from_email, to_email, subject, body, reply_to=reply_to)
This way to the person receiving the email it will appear that it came from user_name and if they reply then their reply email will be sent to user_email.
The main negative of this approach is that if someone looks closely at the address they received the message from they will see the admin email address but most email clients show the name more prominently.
On the plus side you can send as any email address and most people would never notice it came from an admin email address.

Resources