For our sites we use Email with Social share, but the network isn't able to be exported to features and doesn't provide an API. Attached is a patch which adds in the email 'network'.

CommentFileSizeAuthor
#2 share_via_email-2834699-2.patch707 bytesDanielVeza
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

DanielVeza created an issue. See original summary.

DanielVeza’s picture

chrisolof’s picture

So I was going down this route myself until I spotted this in social_share.module's social_share_available_networks() function:

$networks += module_invoke_all('social_networks');

Which means, though not documented in an api.php file, it's actually possible to add networks in via a hook:

/**
 * Implements hook_social_networks().
 */
function example_social_networks() {
  // Add an email social share network.
  return array(
    'email' => array(
      'machine_name' => 'email',
      'human_name' => t('Email'),
      'url' => 'mailto:?subject=%TITLE%&body=%DESC%%0A%0ARead%20more%20at%3A%0A%0A%URL%',
      'locked' => TRUE,
    ),
  );
}

Heads-up that weight does not seem to be respected in 7.x-2.5. Could be fixed in the dev branch (I haven't checked).

chrisolof’s picture

The weight issue was not fixed in 7.x-2.x, so I've opened #2953444: Network weight not respected, and provided a patch.

DanielVeza’s picture

Nice catch mate!