cancel
Showing results for 
Search instead for 
Did you mean: 

Send E-mail from custom dashlet

sokolko
Champ in-the-making
Champ in-the-making
Hello all!
I'm developing a custom dashlet for alfresco share and in some point I want to send an e-mail from my javascript code (for example, from my dashlet "OnReady" function), so I tried using the solution that worked fine in workflow definition:
     
onReady: function MyDashlet_onReady()
      {
         alert("ready");
         var mail = actions.create("mail");
          mail.parameters.to = "sokolko@*****.ru";
          mail.parameters.from = "sokolko@*****.ru";
         mail.parameters.subject = "Alfresco";
         mail.parameters.text = "TEST";
          mail.execute();
         alert("sent");
      },

But it doesn't work. JS console says "actions" is not defined. Does anyone know how can e-mail be sent in the correct way?
2 REPLIES 2

pawel_rzeszowsk
Champ in-the-making
Champ in-the-making
Hi,
your code should work if you put it as a web script deployed on the repository side. Then you could call it from you dashlet deployed on the Share side.
Regards,
Pawel.

sokolko
Champ in-the-making
Champ in-the-making
Thanks, Pawel! I did as you said and it worked Smiley Happy