Sending mail in drupal site - drupal-7

I am using drupal 7 site,In a user profile I have start and end date, I want to send the mail to user every once in a month based on the end date, end date also need to get updated based on the start date every months from current date [start date],please can anyone help me on this! it will be great helpful, Thanks in advance.

You should create your own module, than you should use the hook_cron() where you will get all users and will check the the needed field (f.e. the end date), after when you will have all users which should get email you can use function drupal_mail() and also if you need you can implement hook_mail() in your module.

Related

Button to add one month to current date in text field

I currently use access to store and easily manage gym memberships and customer information etc. I have 3 forms where employees can add a new member, view a current member, and a home page where they can run various other functions like run reports on expired memberships etc.
On the profile form which is what is opened when a member is selected there is an expiry date field which is the date the customers membership expires on. Up until now the employees of the gym have just been manually typing the date +1 month when a customer pays their membership however there have been a few mistakes.
What im trying to do is to create a button which will simply insert todays date +1 month into the expiry text field. To do this i have created a button and use the following VBA Code however this only adds one day, not 1 month, i cant simply add +30 as different months have a different number of days.
++Start VBA Code++
Private Sub cmdAddDate_Click()
On Error GoTo ErrorAddDate
Me.Expiry = Date + 1
ExitAddDate:
Exit Sub
ErrorAddDate:
MsgBox Error.Description
Resume ExitAddDate
End Sub
++End VBA Code++
i can host a copy of the database on my FTP Server if needed but customer information will have to be removed of course.
Thanks in advanced.
Use the DateAdd function:
Me.Expiry = DateAdd("m", 1, Date)

Schedule Nintex Workflow on every 15th of the month querying SP List

I have a SP Custom List with events matrix. I have a Start Date, End Date. I would like to gather all the events from the list that has a start date between 15th of the current month to 15th of the next month and send email notification with details of all those events.
I would like to schedule this workflow to run on every 15th of the month.
Please advise.
Thank you!
For this you would need to build a site workflow because this can be scheduled.
To get the workflow completed:
Step 1. From the workflow use the calculate date action to store the date variable to check for (I.E. between 15th and 15th). Step 2. Use the query list action to find all items (events) that meet that criteria. Step 3. Send email to owners/participant or whomever on those events.

How to set min or max date limit in CakePHP form?

In my current date form input, I have the parameter:
'maxYear' => date('Y')
This lets me limit the max year to this year, but I also need to limit the date selection so users cannot select a date in the future. Using maxYear only allows limiting the year, but I also need months and days.
That's not something you can do with the Form Helper (or the HTML form options even if you'd wrote them manually).
The problem:
If you limit the month to say, 1-7 (if we're currently in July), the user would be unable to select the previous year of any of those months.
The solution:
Use JavaScript onchange validation. When the field(s) change date, check the selected date against your required date range, and give notification if it fails. (see jQuery's .change() documentation if you're using jQuery)
(Then verify on the back-end, as well of course, as JavaScript can easily be manipulated)

Changing ADUC Account expiration date via command saves wrong date

I am trying to make a simple batch file to change a user's ADUC expiration to a specified date.
Using the below command the date always appears in ADUC as one day prior to what I set:
net user myname /expires:09/17/13 /domain
In ADUC, the date will be: 09/16/2013. No matter what, the date that appears in ADUC is one day before the day I set.
The documentation I found for this indicates
Note that the account expires at the beginning of the specified date.
So does this mean, If i wanted the account to be expired today, I would send the command for today and ADUC would interpret that as yesterday?
Thanks in advance, I just want to get this right.
As a wild guess, since you're UTC-savvy - is the date UTC date, so 130917T0000Z=130916T1900 local?

Magento - get list of items from orders for specific date range

Magento database name convention is not trivial. How to get these fields below for last 7 days?
Last Name
First Name
Address
City
State
Zip
Phone
Email
Amount
Order #
Item #
I could not tell if you were looking for some PHP/Magento code or if you are looking to access the database directly. It might be "better" to create yourself a custom module that fetches this info using the Magento/Zend framework, but since I don't know the code off the top of my head I'll redirect you to the following link which has a very nice SQL query that will pull that info for you (and more).
http://www.magentocommerce.com/wiki/groups/207/fedex_-_shipping_view
You probably just need to add something like this to the end to filter the last 7 days
where so.created_at > NOW() - INTERVAL 7 DAY

Resources