diff options
author | Nicolas Wendling <nicolas.wendling1011@gmail.com> | 2021-03-17 22:42:26 +0100 |
---|---|---|
committer | Sean Molenaar <SMillerDev@users.noreply.github.com> | 2021-04-08 23:17:31 +0200 |
commit | ffa476190f90bdc449f1dcc016836ba1a0bd5b38 (patch) | |
tree | 0ba18cd4c8143bca6fef77b24d14fa3c8e745aed | |
parent | 8c2603b93f43acf007be12c03ff8d0828bc0e533 (diff) |
♻️ use Share.getEmailUrl method to share an article via an email.
Signed-off-by: Nicolas Wendling <nicolas.wendling1011@gmail.com>
-rw-r--r-- | js/controller/ShareController.js | 4 | ||||
-rw-r--r-- | templates/part.content.php | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/js/controller/ShareController.js b/js/controller/ShareController.js index eb056ce19..e1255e92a 100644 --- a/js/controller/ShareController.js +++ b/js/controller/ShareController.js @@ -158,4 +158,8 @@ app.controller('ShareController', function (ShareResource, Loading) { this.getTwitterUrl = function(url){ return 'https://twitter.com/intent/tweet?url='+url; }; + + this.getEmailUrl = function(url, object, body){ + return encodeURI('mailto:?subject=' + object + '&body=' + body + ' ' + url); + }; }); diff --git a/templates/part.content.php b/templates/part.content.php index 9bfc86e6d..554382fd1 100644 --- a/templates/part.content.php +++ b/templates/part.content.php @@ -163,11 +163,10 @@ </div> <div ng-if="Share.isSocialAppEnabled('email')" class="col-4"> <a class="icon-dropdown icon-mail pr-5" - ng-href="mailto:?subject=<?php p($l->t('I wanted you to see this article')) ?>&body=<?php p($l->t('Check out this article')) ?>{{ ::item.url }}"></a> + ng-href="{{ Share.getEmailUrl(item.url, '<?php p($l->t('I wanted you to see this article')) ?>', '<?php p($l->t('Check out this article')) ?>') }}"></a> </div> </div> </div> - </ng-container> <!-- End share dropdown --> </div> |