I am using iOS with parse.com and mailgun. I am trying to send an email with a pdf attached. I have read that the parse.com cloudCode doesn't allow attachments. But I have also seen this post, Mailgun: Sending image using parse cloud code ,saying instead of attaching place it inline.
First off, is this still the case, that we cannot send attachments via cloud code? If so, could someone give me a hand in figuring out how to get a pdf from my app into an email sent through mail gun? Im not using the built in mail view from apple because I need to be able to set the "from" address of the email.
I have the pdf created dynamically in the app and I present it in the code like this:
NSString* fileName = @"Invoice.PDF";
NSArray *arrayPaths =
NSSearchPathForDirectoriesInDomains(
NSDocumentDirectory,
NSUserDomainMask,
YES);
NSString *path = [arrayPaths objectAtIndex:0];
NSString* pdfFileName = [path stringByAppendingPathComponent:fileName];
UIWebView* webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 60, 320, 480)];
NSURL *url = [NSURL fileURLWithPath:pdfFileName];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
[webView setScalesPageToFit:YES];
[webView loadRequest:request];
[self.view addSubview:webView];
I don't know how to get the file from the Docdir into the proper data form and either attached (if now possible) or place it inline like the post mentions above.
Any help would be appreciated. If you need more info, have questions or have alternate idea on how to accomplish this task please ask/suggest.
Thanks in advance