We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 49635
    • 63 Posts
    Hello!

    Install components virtuNewsletter
    After reading the letter documents do not come to confirm activation

    Looking through this code snippet found (virtuNewsletter.subscribe):

    $resourceId = $modx->getOption('virtunewsletter.subscribe_confirmation_tpl');
    $resource = $modx->getObject('modResource', $resourceId);
    if (!$resource) {
     $modx->setDebug();
     $modx->log(modX::LOG_LEVEL_ERROR, 'Missing resource tpl for email confirmation');
     $modx->setDebug(FALSE);
    } else {
     $subject = $virtuNewsletter->processElementTags($resource->get('pagetitle'));
     $message = $resource->get('content');
     $message = $virtuNewsletter->parseTpl('@CODE:' . $message, $phs);
     $message = $virtuNewsletter->processElementTags($message);
     $virtuNewsletter->sendMail($subject, $message, $emailTo, $emailFrom, $emailFromName);
    }
    


    Looking in the console error - found that such an error is returned - "Missing resource tpl for email confirmation"

    I do not understand what template I need to specify that I have it work?
    Created as a separate document indicating his ID and chunk and a separate template. The letters do not come for the activation and error logs in the repeated ...
    Where to dig? Did the as documentation ...
      • 49635
      • 63 Posts
      After a long search for a solution - reset component and eventually comes to email a letter ... what was the problem and it is not clear ...

      Now there is another problem, how to install the template email to confirm activation?
      In the e-mail comes header consisting of the letters and text sfdsfsd exactly the same dsgfsgfdg.

      This is the default settings changed only ID template output.
      The search for these letters of component files yielded no results.

      In general, what options are there in this component, the documentation does not sensibly painted on it, as I bring the headline, I bring a message from someone?

      I dig deeper in the code snippet and found

      core/components/virtunewsletter/elements/snippets/virtunewsletter.subscribe.snippet.php

      $scriptProperties['phsPrefix'] = $modx->getOption('phsPrefix', $scriptProperties, 'virtuNewsletter.email.');
      $scriptProperties['nameKey'] = $modx->getOption('nameKey', $scriptProperties, 'name');
      $scriptProperties['categoryKey'] = $modx->getOption('categoryKey', $scriptProperties, 'category');
      $emailTo = $_POST[$scriptProperties['emailKey']];
      $emailFrom = $modx->getOption('emailFrom', $scriptProperties);
      $emailFromName = $modx->getOption('emailFromName', $scriptProperties);
      
      $successMsg = $modx->getOption('successMsg', $scriptProperties);
      


      Okay, so the getOption - this option virtuNewsletter

      [[!virtuNewsletter.subscribe?
       &nameKey=`name`
       &categoryKey=`default category`
       &emailFromName=`Title name`
       &emailFrom=`email from`
      ]]			       
      


      That nothing is specified in the documentation...

      Using, FormIT - in written documents, &emailtpl=`tpl for email`

      How do I connect an email template in this case?

      look further:

      Systems settings:

      virtunewsletter.subscribe_confirmation_tpl - id

      And how do I call?

      [[!virtuNewsletter.subscribe?
       &nameKey=`name`
       &categoryKey=`default category`
       &emailFromName=`Title name`
       &emailFrom=`email from`
      &virtunewsletter.subscribe_confirmation_tpl=`id resources` :)
      or
      &parametr=`[+virtunewsletter.subscribe_confirmation_tpl]`
      ]]
      


      ???
        • 49635
        • 63 Posts
        Hello!

        I found a solution to the problem
        The component creates the templates in the admin panel ...
        Simply select the desired template, to register his title and the text to be sent, in this case the text of the activation

        http://joxi.ru/bmooJJBIlPbvmy