I have an example of sending emails using email composer. At the moment I send emails to a user, but I would like to know how I send the same email to an array of contacts.
then I share my code:
app.js
.controller('General', function($scope){
$scope.EnvioMail= function() {
$scope.contactos=[{correo:"[email protected]"},{correo:"[email protected]"},{correo:"[email protected]"},{correo:"[email protected]"}];
for(var i=0; i<$scope.contactos.length;i++){
alert($scope.contactos[i].correo);
}
$scope.nombre="[email protected]";
if(window.plugins && window.plugins.emailComposer) {
window.plugins.emailComposer.showEmailComposerWithCallback(function(result) {
alert("Response ->");
},
"Esta es una prueba para enviar mails desde tu aplicacion ionic", // Subject
"", // Body
[$scope.nombre], // To EN ESTA PARTE QUIERO ENVIARLE A $scope.contactos[i].correo
null, // CC
null, // BCC
false, // isHTML
null, // Attachments
null); // Attachment Data
}
}
})
index.html
<ion-content ng-controller='General'>
<br><br>
<button class="button button-assertive" ng-click="EnvioMail()">enviar mail</button>
</ion-content>
What I really want is to send this email to $scope.contactos[i].correo