[英]How to access the owner email of win in salesforce iOS
假設我有一個名為SalesSample的應用程序。 使用Salesforce,我的一個隊友贏得了Salesforce的一筆交易,但未使用SalesSample應用。 即使他們不使用SalesSample,我也可以通過SalesSample應用發送電子郵件給交易贏家嗎? Salesforce API是否可以讓我們訪問贏得交易的人的電子郵件? 如果可能的話,有人可以給我有關如何執行此操作的步驟。
終於找到了解決方案。 我只是查詢記錄的機會,請檢查擁有它的用戶。
NSString *theRequest = [NSString stringWithFormat:@"SELECT Owner.Email FROM Opportunity "];
SFRestRequest *request = [[SFRestAPI sharedInstance] requestForQuery:theRequest];
[[SFRestAPI sharedInstance] send:request delegate:self];
然后通過MessageUI.framework使用電子郵件:
- (void)showEmail:(id)sender {
NSString *emailTitle = @"Email Subject";
NSString *messageBody = @"Email Content";
NSArray *toRecipents = [NSArray arrayWithObject:@"Returned Email from query here"];
MFMailComposeViewController *mc = [[MFMailComposeViewController alloc] init];
mc.mailComposeDelegate = self;
[mc setSubject:emailTitle];
[mc setMessageBody:messageBody isHTML:NO];
[mc setToRecipients:toRecipents];
[self presentViewController:mc animated:YES completion:NULL];
}
- (void) mailComposeController:(MFMailComposeViewController *)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError *)error
{
if(error) {
UIAlertView *errorView = [[UIAlertView alloc] initWithTitle:@"Mail Error" message:[error localizedDescription] delegate:self cancelButtonTitle:nil otherButtonTitles:@"OK", nil];
[errorView show];
} else {
switch (result)
{
case MFMailComposeResultCancelled:
NSLog(@"Mail cancelled");
break;
case MFMailComposeResultSaved:
NSLog(@"Mail saved");
break;
case MFMailComposeResultSent:
NSLog(@"Mail sent");
break;
case MFMailComposeResultFailed:
NSLog(@"Mail sent failure: %@", [error localizedDescription]);
break;
default:
break;
}
}
// Close the Mail Interface
[self dismissViewControllerAnimated:YES completion:NULL];
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.