A few days ago I explained how Constellational, the app I’m building to sharing notes, lets you share your posts via email if it’s a draft or an edit you’re working on. Today I found out that React Native now supports subject lines when sharing through email.
This is something I’ve wanted for a while, because an email without a subject is an email that’s not going to get read. You know how many emails are lying unopened in your inbox.
The change I had to make to my app’s code was tiny:
var username = SettingStore.getUsername();
var post = this.props.post;
var url = URL + '/' + username + '/' + post.id;
var options = {subject: post.data.split('\n')[0]};
if (post.isDraft || post.hasUnpublishedEdits) {
options.message = post.data;
} else {
options.url = url;
}
ActionSheetIOS.showShareActionSheetWithOptions(options, this.shareFailure, this.shareSuccess);
Note that I’m taking the first line of the post as the email’s subject, perhaps this should be trimmed. This fixes #39.
Want to share your notes? Sign up here!