I'm having trouble with the coresuite code to read the value of the email of a contact in BP. This code works:
string email = SwissAddonFramework.UI.Components.TextEdit.GetFromUID(pVal.Form, "60").Value; //(for business partner email)
but this fails:
string email = SwissAddonFramework.UI.Components.TextEdit.GetFromUID(pVal.Form, "107").Value; //(for contact email)
Does anyone know the correct format please? Thank you all
Related
I have cretaed an Emaail service and associated an Apex class with it. The Apex class does a simple job of checking the subject of the mail and insert a record in the contact object, if the suject matches witha particular string. The last name of the contact is extracted from the inbound mail body.
The code is as follows:
global class CreateContactFrmEmail implements Messaging.InboundEmailHandler {
global Messaging.InboundEmailResult handleInboundEmail(Messaging.InboundEmail email, Messaging.InboundEnvelope envelope) {
Messaging.InboundEmailResult result = new Messaging.InboundEmailresult();
String subToCompare = 'Create Contact';
if(email.subject.equalsIgnoreCase(subToCompare))
{
Contact c = new Contact();
c.LastName = email.plainTextBody;
insert c;
}
result.success = true;
return result;
}
}
However, whenever I send a mail to the generated email address, it is unable to create the contact, the mail bounces and the following exception is reported.
Any help in this regard is appreciated. TIA.
I have tried to use the search function, but did not find a solution for my problem, or I do not understand enough yet.
I have written a script for google forms, that sends an automatic email to two email addresses, when an user submits the form. I have build in some information that should show in the email subject and puts the input from the forms into the email, with some simple HTML formatting.
My problem is, that the emails always have my Email address as the sender (the account I used for creating the form)
I would like to have the senders email, the one that is submitting the form.
How is that possible?
Here is the code:
function sendFormByEmail(e)
{
// Sent to Email address
var email1 = "123#abc.com";
var email2 = "345#abc.com";
// Variables
var s = SpreadsheetApp.getActiveSheet();
var headers = s.getRange(1,1,1,s.getLastColumn()).getValues()[0];
var txt = "";
var subject = "Example text: ";
// Var e = form input as array.
// Loop through the array.
for(var i in headers){
txt += "<b>" + headers[i] + '</b>' + ': '+
e.namedValues[headers[i]].toString() + '<br><br>';
}
// Insert variables from the spreadsheet into the subject.
// Create email subject
subject += "Example text " + e.namedValues[headers[2]].toString();
// Send the email
MailApp.sendEmail(email1, subject, "", {htmlBody:txt});
MailApp.sendEmail(email2, subject, "", {htmlBody:txt});
}
It is not possible to send the mail as the user who submitted the form as the script is running from the user account and the mailapp will send the mail from that account only. you can change the display name according to the user name who submiited the form by the parameter name. Also you can change the email to noreply#domainName.com by adding the parameter noReply in mailApp syntax. However you cannot change it to the user who submitted the form
You can refer this documentation for the above parameters : https://developers.google.com/apps-script/reference/mail/mail-app
Hope this could help
I went into the developer portal and created a test account for a non US account. Transaction with this credit card number with the C# code below works fine.
But, my question is whatever the country code is provided, paypal soap api allow me to do the transaction without out any problem. Is this a correct behavior or there is some setting that can enforce the API to validate the country.
//address of the card owner
var cardOwnerAddress = new AddressType
{
Street1 = request.BuyerAddress1,
Street2 = request.BuyerAddress2,
CityName = request.BuyerCity,
StateOrProvince = request.BuyerState,
PostalCode = request.BuyerZipCode,
CountryName = "USA",
Country = CountryCodeType.US, // country code
CountrySpecified = true
};
//card owner object
var cardOwner = new PayerInfoType
{
Payer = "",
PayerID = "",
PayerStatus = PayPalUserStatusCodeType.unverified,
PayerCountry = cardOwnerAddress.Country, // country code
Address = cardOwnerAddress,
PayerName = cardOwnerPayerName
};
Typically, with AVS - Address Verification System(s), and also CVV2 the most done is checking the street number and numbers from the postal/zip code (numbers because they are constant, where people can type "st.", "street", "st" etc for their address. Thus the country really doesn't matter.
Names, for some cards, can be checked too, though as you can imagine, this can be a pain with people not typing their name exactly as it appears.
You can also, with PayPal, set filters in your account to specify which countries you will accept payment for - though this has nothing to do with verification, it's just PayPals layer on top.
Paypal list out what verification you can set up here
https://developer.paypal.com/docs/classic/api/AVSResponseCodes/
And a little information on AVS can be found here https://en.wikipedia.org/wiki/Address_Verification_System
I'm using the PayPal Merchant SDK for .NET (v 2.15.117) and am trying to retrieve the shipping address info, customer's email address, and phone number from the GetExpressCheckoutDetailsRequestType.GetExpressCheckoutDetailsResponseDetails call. The shipping address is populated as expected but for the life of me, I can't figure out how to get the buyer's email or phone number. At a minimum we have to have the email to communicate about the order (ie tracking emails).
I see a BuyerMarketingEmail property but it is null and I am under the impression that is an optional email the buyer can choose to provide. For phone, I see a PayerInfo.ContactPhone property but that is also null (and I'm less concerned about having that but it would be nice for customer service issues or to give to ground shippers like FedEx).
I am using the PayPal sandbox if that matters.
What am I missing?
var getExpressCheckoutDetails = new GetExpressCheckoutDetailsReq();
var getExpressCheckoutDetailsRequest = new GetExpressCheckoutDetailsRequestType(token);
getExpressCheckoutDetails.GetExpressCheckoutDetailsRequest = getExpressCheckoutDetailsRequest;
var service = new PayPalAPIInterfaceServiceService();
paypalResponse = service.GetExpressCheckoutDetails(getExpressCheckoutDetails);
if (paypalResponse != null)
{
//Success values check for a matching PayerID to validate the token response
if (paypalResponse.Ack.ToString().Trim().ToUpper().Equals("SUCCESS") &&
PayerID == paypalResponse.GetExpressCheckoutDetailsResponseDetails.PayerInfo.PayerID)
{
checkout.ShippingInfo.ShippingName = paypalResponse.GetExpressCheckoutDetailsResponseDetails.PayerInfo.Address.Name;
checkout.ShippingInfo.ShippingAddress1 = paypalResponse.GetExpressCheckoutDetailsResponseDetails.PayerInfo.Address.Street1;
checkout.ShippingInfo.ShippingAddress2 = paypalResponse.GetExpressCheckoutDetailsResponseDetails.PayerInfo.Address.Street2;
checkout.ShippingInfo.ShippingCity = paypalResponse.GetExpressCheckoutDetailsResponseDetails.PayerInfo.Address.CityName;
checkout.ShippingInfo.ShippingState = paypalResponse.GetExpressCheckoutDetailsResponseDetails.PayerInfo.Address.StateOrProvince;
checkout.ShippingInfo.ShippingZip = paypalResponse.GetExpressCheckoutDetailsResponseDetails.PayerInfo.Address.PostalCode;
checkout.ShippingInfo.ShippingCountry = paypalResponse.GetExpressCheckoutDetailsResponseDetails.PayerInfo.Address.Country.ToString();
//these next two are always null
checkout.BillingInfo.Email = paypalResponse.GetExpressCheckoutDetailsResponseDetails.BuyerMarketingEmail;
checkout.ShippingInfo.PhoneNumber = paypalResponse.GetExpressCheckoutDetailsResponseDetails.PayerInfo.ContactPhone;
}
}
Thought I'd post an answer to wrap this up -
As stated above in my comment to the original question, the email address of the buyer is PayerInfo.Payer.
Also, suddenly/magically, PayerInfo.ContactPhone began returning the phone number instead of null. I can only chalk that up to something in the Sandbox environment or my sandbox user account.
Here below is the code to send an email with play-mailer:
import play.api.libs.mailer._
...
val email = Email(
"My Subject",
"Me <j3d#domain.com>",
Seq("john#domain.com", "joe#domain.com", "jack#domain.com"),
bodyText = Some("Some text..."),
bodyHtml = Some("<p>Some text...</p>")
)
MailerPlugin.send(email)
The problem is that receivers see all the recipients the email was sent to. Of course, an option could be to invoke MailerPlugin.send for every single recipient... but I'm wondering if there is a better way to ensure each receiver sees only his or her email address in the to field.
Perhaps the best solution will be using hidden recepient which aka BCC. Emailer plugin has method addBcc(String address):
public void addBcc(String address) {
this.bcc.add(address);
}
Regards!