{"action":"created","issue":{"url":"https://api.github.com/repos/chirag04/react-native-mail/issues/14","repository_url":"https://api.github.com/repos/chirag04/react-native-mail","labels_url":"https://api.github.com/repos/chirag04/react-native-mail/issues/14/labels{/name}","comments_url":"https://api.github.com/repos/chirag04/react-native-mail/issues/14/comments","events_url":"https://api.github.com/repos/chirag04/react-native-mail/issues/14/events","html_url":"https://github.com/chirag04/react-native-mail/issues/14","id":141620716,"number":14,"title":"Question: Syntax for adding multiple attachments?","user":{"login":"esutton","id":6115047,"avatar_url":"https://avatars.githubusercontent.com/u/6115047?v=3","gravatar_id":"","url":"https://api.github.com/users/esutton","html_url":"https://github.com/esutton","followers_url":"https://api.github.com/users/esutton/followers","following_url":"https://api.github.com/users/esutton/following{/other_user}","gists_url":"https://api.github.com/users/esutton/gists{/gist_id}","starred_url":"https://api.github.com/users/esutton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/esutton/subscriptions","organizations_url":"https://api.github.com/users/esutton/orgs","repos_url":"https://api.github.com/users/esutton/repos","events_url":"https://api.github.com/users/esutton/events{/privacy}","received_events_url":"https://api.github.com/users/esutton/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-03-17T15:41:18Z","updated_at":"2016-03-21T21:12:53Z","closed_at":null,"body":"This is probably a javascript newbie problem.  What would syntax look like for multiple email file attachments?\r\n\r\nI tried the following which is apparently not correct javascript.  My goal is to iterate through my fileAttachmentList array and build the Mailer.mail attachment object.\r\n\r\n```\r\n    Mailer.mail({\r\n      subject: subjectText,\r\n      recipients: ['edward.sutton@subsite.com'],\r\n      body: bodyText,\r\n      attachment: {\r\n        path: this.state.fileAttachmentList[0].fileNamePath,\r\n        type: this.state.fileAttachmentList[0].fileMimeType,\r\n        name: this.state.fileAttachmentList[0].fileName,\r\n      },\r\n      {\r\n        path: this.state.fileAttachmentList[1].fileNamePath,\r\n        type: this.state.fileAttachmentList[1].fileMimeType,\r\n        name: this.state.fileAttachmentList[1].fileName,\r\n      }\r\n    }, (error, event) => {\r\n      if(error) {\r\n        Alert.alert('Error', 'Could not send mail');\r\n      }\r\n    });\r\n```\r\nThank you *very* much for sharing your work on such a great react-component !"},"comment":{"url":"https://api.github.com/repos/chirag04/react-native-mail/issues/comments/199489378","html_url":"https://github.com/chirag04/react-native-mail/issues/14#issuecomment-199489378","issue_url":"https://api.github.com/repos/chirag04/react-native-mail/issues/14","id":199489378,"user":{"login":"esutton","id":6115047,"avatar_url":"https://avatars.githubusercontent.com/u/6115047?v=3","gravatar_id":"","url":"https://api.github.com/users/esutton","html_url":"https://github.com/esutton","followers_url":"https://api.github.com/users/esutton/followers","following_url":"https://api.github.com/users/esutton/following{/other_user}","gists_url":"https://api.github.com/users/esutton/gists{/gist_id}","starred_url":"https://api.github.com/users/esutton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/esutton/subscriptions","organizations_url":"https://api.github.com/users/esutton/orgs","repos_url":"https://api.github.com/users/esutton/repos","events_url":"https://api.github.com/users/esutton/events{/privacy}","received_events_url":"https://api.github.com/users/esutton/received_events","type":"User","site_admin":false},"created_at":"2016-03-21T21:12:53Z","updated_at":"2016-03-21T21:12:53Z","body":"After browsing /RNMail/RNMail.m I think the answer is that only a single file attachment is currently supported.\r\n\r\nI think the easiest method might be to pass an 'attachments' array containing only file path name of each file.  Then in the Objective-C code, strip file name from path, and determine mime type from file extension.\r\n\r\nThis is not ideal, but I have no idea how to pass an array of attachment objects into Objective-C.  Maybe I can find an example someplace.\r\n\r\n"}}