Skip to main content
added 187 characters in body
Source Link
arpitr
  • 7.9k
  • 2
  • 23
  • 48

I am not sure about what kind of verification emails you are sending, though I believe if you peep inside drupal core user module you can get hold of function which does the same,as for user registration process we have email verification option also.

A very simple straight custom way might go in the following way

  1. How you will be generating the verification code?
  1. Create a custom table with column as email,random_string,verified
  2. once you have generated it, make a db query to insert the link you created a point back against the email user entered and set verified to 0 in the custom table.
  3. send the email
  4. In your custom module implement hook_menu() with menu entry fir "email-verification" .
  5. In the page callback using wild card check if the random_string exists in you custom table, if so set verified to 1

Not exact but close to what you may need.

Update:

global $base_url;
$random_string = substr(str_shuffle(md5(time())),0,10);
// Link 
$email_link = $base_url . "/email-verification/" . $random_string;

I am not sure about what kind of verification emails you are sending, though I believe if you peep inside drupal core user module you can get hold of function which does the same,as for user registration process we have email verification option also.

A very simple straight custom way might go in the following way

  1. How you will be generating the verification code?
  1. Create a custom table with column as email,random_string,verified
  2. once you have generated it, make a db query to insert the link you created a point back against the email user entered and set verified to 0 in the custom table.
  3. send the email
  4. In your custom module implement hook_menu() with menu entry fir "email-verification" .
  5. In the page callback using wild card check if the random_string exists in you custom table, if so set verified to 1

Not exact but close to what you may need.

I am not sure about what kind of verification emails you are sending, though I believe if you peep inside drupal core user module you can get hold of function which does the same,as for user registration process we have email verification option also.

A very simple straight custom way might go in the following way

  1. How you will be generating the verification code?
  1. Create a custom table with column as email,random_string,verified
  2. once you have generated it, make a db query to insert the link you created a point back against the email user entered and set verified to 0 in the custom table.
  3. send the email
  4. In your custom module implement hook_menu() with menu entry fir "email-verification" .
  5. In the page callback using wild card check if the random_string exists in you custom table, if so set verified to 1

Not exact but close to what you may need.

Update:

global $base_url;
$random_string = substr(str_shuffle(md5(time())),0,10);
// Link 
$email_link = $base_url . "/email-verification/" . $random_string;
Source Link
arpitr
  • 7.9k
  • 2
  • 23
  • 48

I am not sure about what kind of verification emails you are sending, though I believe if you peep inside drupal core user module you can get hold of function which does the same,as for user registration process we have email verification option also.

A very simple straight custom way might go in the following way

  1. How you will be generating the verification code?
  1. Create a custom table with column as email,random_string,verified
  2. once you have generated it, make a db query to insert the link you created a point back against the email user entered and set verified to 0 in the custom table.
  3. send the email
  4. In your custom module implement hook_menu() with menu entry fir "email-verification" .
  5. In the page callback using wild card check if the random_string exists in you custom table, if so set verified to 1

Not exact but close to what you may need.