Opening Email App by passing Variables


#1

I am new to ionic and need a small help.
https://i.imgur.com/u9RPuH1.png (628kB)

On clicking the alert icon i want to open email like this :

cordova.plugins.email.open({
   to:      'max@mustermann.de',
   cc:      'erika@mustermann.de',
   subject: 'Report Comment',
   body:   {{item.author_name}} + {{item.id}};
});

How can i do this. Here is the screenshot of my code.

<ion-view>
    <ion-nav-title>
        <span>{{'Comment' | translate}}</span> <span dir="ltr">({{comments.length}})</span>
    </ion-nav-title>
    <ion-content scroll="false" style="background:#272625;">
        <div class="absolute width-100 content-login padding-horizontal padding-top">
            <div class="padding-bottom" ng-show="!isLogin">
                <p class="comment-alert">To leave a comment, login or register below</p>
                <button ui-sref="app.login" class="bar-button button-block login-email box-shadow" style="min-height:40px">LOGIN</button>
            </div>
            <div class="padding-bottom" ng-show="isLogin">
                <textarea ng-model="data.content" class="text-comment" placeholder="{{'content'|translate}}"></textarea>
            </div>
            <div class="padding-bottom" ng-show="isLogin">
                <button type="submit" class="bar-button button-block login-email box-shadow" style="min-height:40px" ng-click="AddAComment()">{{'addComment' | translate}}</button>
            </div>
        </div>
        <ion-scroll class="comment-content" ng-class="{'guest':!isLogin}">
            <div class="card show-comment" ng-repeat="item in comments">
                <div class="item item-avatar comments">
                    <img ng-src="{{item.mobiconnector_local_avatar}}" style="position:absolute;top:0px;left:0px;">
                        <b style="font-size:12px;display:block;line-height:1">{{item.author_name}}</b>
                        <span style="font-size:9px;"class="info-news">{{item.time | timeAgo}}</span>
                        <div style="float:right;">
                            <a class="item item-icon-right" ng-click="cordova.plugins.email.open({
    to:      'max@mustermann.de',
    cc:      'erika@mustermann.de',
    subject: 'Report Comment',
    body:   {{item.author_name}} + {{item.id}};
});">
                                <i class="icon ion-alert" style="font-size:12px"></i>
                            </a>
                        </div>
                        </div>
                <span class="content-comments" ng-bind-html="$sce.trustAsHtml(item.content.rendered)"></span>
            </div>
            <ion-infinite-scroll ng-if="!overComments" on-infinite="load()" distance="1%"></ion-infinite-scroll>
        </ion-scroll>
    </ion-content>
</ion-view>


#2

I fixed it. Just had to create function in controller with $scope variable to run it.