How to create multiple email form in wordpress - wordpress

I want to create a form which send message on multiple email address
can this possible using WordPress?

yes you can. Use wp_mail function. here is refference http://codex.wordpress.org/Function_Reference/wp_mail
just remember there is a search engin called Google.You can easily find these kind of things from Google.You just need to type and hit enter.
Thank you

Related

User access to CPT (Custom Post Type) without access to regular posts

I have created a custom post type that for the sake of this question we can call "my_cpt".
I have also created a new role which we can call "my_role".
What I want to do is give "my_role" access to "my_cpt" without adding the "edit_posts" capability because that gives access to other post types which I do not want the role to have access to.
I have tried variations of numerous bits of code I have found but none have worked so I don't really know where to begin. Based on that I don't have any base code to display here.
A plugin like this one should enable you to do this: https://www.role-editor.com/
Ended up being easier than I thought.
I created a couple capabilities... "read_my_cpt" and "edit_my_cpt".
The "my_role" has permissions to both the capabilities.
I then just had to change the capability_type for the CPT to "my_cpt" instead of "post"

How to pass mail tokens to the admin user settings

How could i pass custom mail tokens from my custom module to the admin user settings page.In the admin user settings page I see a part like Welcome, awaiting administrator approval.In this part it shows the available variables are: !username, !site, !password, !uri, !uri_brief, !mailto, !date, !login_uri, !edit_uri, !login_url.Is there any way by which i could add my own custom variables so that it can be accessed in the corresponding mail body..?I need to pass some variables from my custom module to this user setings part.Could some one help me with this..
For someone who might be looking for the solution,here is how i solved it.Do check the link below to see how to create your own tokens in the user admin settings.Its was a very quite useful piece of code .Anyways thanks to the uploader.. :)
http://www.innoraft.com/blog/use-profile-fields-tokens-user-emails-drupal

Webform submission: how to send the translation of a variable by mail

In a Drupal project, i have a basic weborm. As soon as the user submits one, an email is send with all the things he just wrote.
Example:
Imp_First_Name:%value[firstname]
Imp_Last_Name:%value[lastname]
Imp_City:%value[lastname]
Imp_Country:%value[country]
Imp_Email:%value[email]
Imp_Subject:%value[subject]
I have a problem on this line:
Imp_Subject:%value[subject]
Subject contains what the user have selected within a select list. My problem is when the website is set to chinese, all is written in chinese obviously but i don't want the chinese version to be sent. I need the english one.
For example :
In my webform, the user has the choice between 3 countries:
Afghanistan|阿富汗
Afrique du Sud|南非
Albanie|阿尔巴尼亚
I need the country name in latin alphabet ! How can i manage to do this?
thanks in advance for your help
It's a tricky one...
There is substitution and also two possible template layers. One comes from webform and second comes from mailsystem / mail handler module.
I'm assuming that the substitution is done before the template layer so the t() function should be applied either within a hook on that level or within the proper template file.
Debugging with XDebug would really help to solve the issue.

wordpress I have create change Password Functionality through my new Plugin in wordpress how to match the user enterd Password?

I need password check function in wordpress for change Password functionlity.I have use wp_check_password( $opass,$pass,$user_id ); function but I got wrong results Any one Help me?
How exactly are you using wp_check_password? According to the codex, the second argument needs to be the encrypted password - are you passing it encrypted?
Take a look at wp_authenticate_username_password in wp-includes/user.php to see how WordPress does it; or even call wp_authenticate_username_password itself.

Check if user agreed to terms , set cookie

I'm a Drupal nub. I would like to check on every page if user (anonymouse) agreed to somekind of terms. I suppose i should write small custom module ?
Where will this condition be written
if(!$_COOKIE('confirm')){
//jQuery show confirmation form
//Set cookie for 1hour
}
maybee in page.tpl.php ? Please, give me some tips ..
If you don't want to store the info for a long time, you should use $_SESSION variable. Then in preprocess page you could check if the user has accepted and set a variable that you can use in your page.tpl.php.
user_save() accepts an array argument which you can put custom data into. This will then be loaded with your $user object and you can use in any template file.
Check out these modules:
http://drupal.org/project/legal
http://drupal.org/project/terms_of_use
The Legal and TOS modules are good if you need a login. If working with anonymous users, however, you'll need to use the rules module with https://www.drupal.org/project/rules_session_vars.

Resources