headers: { "Authorization" : "Accountkey {{Accountkey}}" },

5 posts, 1 answers
  1. Vasco
    Vasco avatar
    11 posts
    Member since:
    Nov 2013

    Posted 26 Jan 2014 Link to this post

    hello

    acording to this page: http://docs.telerik.com/platform/backend-services/development/rest-api/email-templates/send-email

    " The request must use AccountKey authentication. In the body of the request you must provide recipients list and context object. "

    what's the accountkey authentication ?

    on my backend-services- > Api Keys I only get:
    Application Name
    API Key
    API Master Key

    where's the accountkey ??

    thk u
    Vasco Barbosa

  2. Vasco
    Vasco avatar
    11 posts
    Member since:
    Nov 2013

    Posted 27 Jan 2014 in reply to Vasco Link to this post

    no one?
  3. Anton Dobrev
    Admin
    Anton Dobrev avatar
    539 posts

    Posted 27 Jan 2014 Link to this post

    Hello Vasco,

    We are sorry for the ambiguity in some parts of our documentation. This is something we are going to fix asap.

    Please find below a more comprehensive code snippet:

    $.ajax({
        type: "POST",
        contentType: "application/json",
        headers: { "Authorization": "MasterKey your-api-master-key-here" },
        data: JSON.stringify(recipients),
        success: function (data) {
            alert("Email successfully sent.");
        },
        error: function (error) {
            alert(JSON.stringify(error));
        }
    })


    In order to execute the code snippet add:

    • the API key of the application at the place of application-id-here
    • the name of the template you want to send (e.g. WelcomeEmail) at the place of
      template-name-here
    • the API master key instead of your-api-master-key-here

    Please, do not hesitate to contact us if you have any other questions.

    Regards,
    Anton Dobrev
    Telerik

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  4. Vasco
    Vasco avatar
    11 posts
    Member since:
    Nov 2013

    Posted 27 Jan 2014 in reply to Anton Dobrev Link to this post

    I'll try this, 

    but as instructed, the masterkey should be on deployment right?
  5. Answer
    Anton Dobrev
    Admin
    Anton Dobrev avatar
    539 posts

    Posted 28 Jan 2014 Link to this post

    Hello,

    The master key for your application should be used only by yourself (or by any collaborators you might have to this project) and not deployed with your app. We have provided an example using the MasterKey authentication only to showcase in a fast way the Emails feature of Telerik Backend Services.

    Let us explain more on the integrated and additional email functionality offered by Telerik Backend Services.

    1.  Integrated

    In Backend Services you have an "out-of-the-box" email sending strategy for:
    • welcoming newly registered users
    • sending verification emails
    • sending confirmation emails when a user password is reset
    This feature can be enabled/disabled from the left pane in your Backend project - Settings - Email notifications.

    2. Additional

    Note that sending emails is based on templates. The templates are to be found in the Emails tab of the portal's left navigation pane. You can add additional email templates (subject to a subscription plan) customized for a certain scenario.

    The sending of automated emails feature is best managed through the Cloud Code (intended to be the business logic layer for your app). An example how to send emails from the Cloud code can be found here. Thus, when certain event occurs you can send an automated email to the interested parties.

    Please, let us know if  this answers your question.

    Regards,
    Anton Dobrev
    Telerik

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top