Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rebased multiple attachments #85

Closed
wants to merge 2 commits into from

Conversation

adamski
Copy link
Contributor

@adamski adamski commented Nov 8, 2017

Rebased #11 (the first PR for multiple attachments). Tested and working on iOS.

Breaking changes

attachment:{} is now attachments:[], e.g.:

Mailer.mail({
      subject: 'My email with attachments',
      recipients: [],
      body: 'Check this out',
      isHTML: true,
      attachments: [{
        path: this.imageFilePath,  // The absolute path of the file from which to read data.
        type: 'png',   // Mime Type: jpg, png, doc, ppt, html, pdf
      },{
        path: this.audioFilePath,
        type: 'wav',   
      }]
    }, (error, event) => {
      Alert.alert(
        error,
        event,
        [
          {text: 'OK', onPress: () => console.log('OK: Email Error Response')},
        ],
        { cancelable: true }
      )
    });

@adamski
Copy link
Contributor Author

adamski commented Nov 8, 2017

This works with multiple image files, or image + audio files (see #84). Strangely initial tests with text/json files did not seem to work.

@adamski adamski changed the title Rebase multi-attachment PR Rebased multi-attachment PR Nov 8, 2017
@adamski adamski changed the title Rebased multi-attachment PR Rebased multiple attachments Nov 8, 2017
@tomislavHonig
Copy link

This is really cool feature. Will it be merged to the master?

@tomislavHonig
Copy link

tomislavHonig commented Nov 16, 2017

And, it's not working on Android with multiple attachments. But i have fixed it, i can send you the RNMailModule.java if you want.

@adamski
Copy link
Contributor Author

adamski commented Nov 16, 2017

@tomislavHonig please send a PR to my fork, I will merge there and then it will appear here.
Or alternatively you can send me the java file and I'll merge it that way..

@tomislavHonig
Copy link

Thing is i am using FileProvider https://developer.android.com/reference/android/support/v4/content/FileProvider.html and you need to set this up in the androidManifest and create xml folder with provider_paths.xml file inside it. Don't know if you can do that inside the module, i think it needs to be done on application level.

@Sprit3Dan
Copy link

Any updates on this? Need this feature either.

@chirag04
Copy link
Owner

chirag04 commented Nov 27, 2017

@adamski can you rebase. seems like the formatting/indentation is off.

@adamski
Copy link
Contributor Author

adamski commented Nov 27, 2017

@chirag04 formatting seems fine? I thought I'd fixed the indentation issue. Please link to the specific line numbers you're seeing. Also would be good to include @tomislavHonig's Android fixes too.

@adamski
Copy link
Contributor Author

adamski commented Dec 11, 2017

Closing, replaced with #92

@adamski adamski closed this Dec 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants