2017 © Pedro Peláez
 

elgg-plugin mailgun_mailin

Turns inbound emails into new site content

image

arckinteractive/mailgun_mailin

Turns inbound emails into new site content

  • Thursday, August 18, 2016
  • by hypeJunction
  • Repository
  • 5 Watchers
  • 0 Stars
  • 15 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Mailgun - Content Mail-In

Elgg 2.0, (*1)

Allows users to post new content by emailing it, (*2)

Supports new:, (*3)

  • Blogs
  • Bookmarks
  • Files
  • Discussions

Customizations

Adding a custom parser

To add a new content type to supported items, register a handler for 'mailin:types','mailgun' and add your type definition to the list. Type definition contains a callable handler and a list of allowed fields:, (*4)


elgg_register_plugin_hook_handler('mailin:types', 'mailgun', function($hook, $type, $return) { $return['event'] = [ 'handler' => 'my_mailin_event_parser', 'fields' => [ 'date', 'location', 'description', ], ]; }); function my_mailin_event_parser(\ArckInteractive\Mailgun\Message $message, $fields) { $date = strtotime($fields['date']); $location = $fields['location']; if (!$date || !$location) { return false; } // save the event // note that this will be performed via cron, so there is no logged in user // you will need to set ignored access after checking container/edit permissions return true; }

Once this is set, the user will see a EVENT type with a list of fields in their settings: Settings > Content Mail-In., (*5)

Users can then send an email in the following format:, (*6)

**Subject**
EVENT: Birthday party

**Message**
DATE: August 10, 2017 10:00
LOCATION: Some venue
DESCRIPTION:
I am hosting a birthday party, so come help me celebrate

The Versions

18/08 2016

dev-master

9999999-dev

Turns inbound emails into new site content

  Sources   Download

GPL-2.0

The Requires

 

by Ismayil Khayredinov

plugin email notification elgg

18/08 2016

1.0.0

1.0.0.0

Turns inbound emails into new site content

  Sources   Download

GPL-2.0

The Requires

 

by Ismayil Khayredinov

plugin email notification elgg