Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1028351
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T12:22:27+00:00 2026-05-16T12:22:27+00:00

good morning, I have created a new content type – petition, a last step

  • 0

good morning, I have created a new content type – petition, a last step has to be verification of their mail address by sending them a link to prove or to delete them from the petition.

I need to get some sort of unique link which then I send as tokenized action mail to the mail account provided in the form. the tokenized link should then set their mail address valid and should be able to unpublish the post as well.

I am a bit desperate here, general directions are appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T12:22:28+00:00Added an answer on May 16, 2026 at 12:22 pm

    Here’s an example on how to change content of a node and how to send a mail when a node is created (but you can send a mail as well when a form is filled in). You should be able to adapt it to work with your setup.

    A node is created and is not published by default. Here I will set the node as published when someone clicks a link in a mail.

    Create a custom module that talks to the nodeapi:

    function module_nodeapi($node, $op, $a3 = NULL, $a4 = NULL){
    
        if($node->type == 'petition'){
            switch ($op) {
                case 'submit':
    
                case 'insert':
                     $mail = $user->mail;
                     $nodeid = $node->nid;
                         // mail the user using the drupal_send_mail() function
                         // make the link something like: http://web.be/petition/validate/$nodeid/$mail
                         // drupal_set_message('thank you for validating the petition');
                case 'update':
                break;
            }
        }
    

    So an example of the link is http://web.be/petition/validate/20/test@test.com . Next thing to do is use the hook_menu to get the link and it’s variables (also in your custom module):

    function module_menu(){
        $items['petition/valid/%/%'] = array(
            'title' => 'Validated your petition-entry',
            'page callback' => 'module_validate_petition',
            'page arguments' => array(1,2),
            'access arguments' => array('access content'),
            'type' => MENU_CALLBACK,
        );
    }
    
    function module_validate_petition($nid, $mail){
        // load the node
        $node = node_load($nid);
        // set to published
        $node->status = 1;
        // save the node
        node_save($node);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Good Morning, I have created an ASP.NET 3.5 webform that allows users to search
Good morning. I have the following conditions in radiobutton <td> @Html.RadioButtonFor(model => model.ImagensSelecionadas, new
Good Morning, I have copied this code from somewere <script type=text/javascript> $(function() { setInterval(rotateImages(),
good morning, I was trying the SharedPreferences Class and I have created two classes,
Good Morning, As stupid as my question might sound, i have spent the last
Good Morning, I have created a structure to be a cut down version of
Good Morning, I have created my first generic method pieced together from a bunch
Good Morning All, I have created a different background and a few other images
Good Morning, i have some Trouble with the Zend Framework and Zend_DB_Select, i want
Good Morning, I'm working on an ASP.NET 3.5 webforms application and have written the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.