Class: WHMCS::Misc
Overview
The WHMCS::Misc class contains miscelaneous WHMCS API functions
Class Method Summary collapse
-
.add_banned_ip(params = {}) ⇒ Object
Add Banned IP.
-
.add_product(params = {}) ⇒ Object
Add Product.
- .decrypt_password(params = {}) ⇒ Object
- .encrypt_password(params = {}) ⇒ Object
- .get_activity_log(params = {}) ⇒ Object
- .get_admin_details ⇒ Object
- .get_currencies ⇒ Object
- .get_email_templates(params = {}) ⇒ Object
- .get_promotions(params = {}) ⇒ Object
- .get_staff_online ⇒ Object
- .get_stats ⇒ Object
- .get_todo_item_statuses ⇒ Object
- .get_todo_items(params = {}) ⇒ Object
-
.log_activity(params = {}) ⇒ Object
Log Activity.
-
.send_admin_email(params = {}) ⇒ Object
Send Admin Email This command is used to send an email to Admin users.
- .update_admin_notes(params = {}) ⇒ Object
-
.update_todo_item(params = {}) ⇒ Object
Up To-Do Item.
Methods inherited from Base
Class Method Details
.add_banned_ip(params = {}) ⇒ Object
Add Banned IP
Parameters:
- :ip - IP address to ban Optional attributes:
- :reason - reason for ban
- :days - number of days to ban for. If not submitted defaults to 7 (not required)
- :expires - in YYYY-MM-DD HH:II:SS format eg: 2011-06-06 01:12:34 (optional in place of "days")
See:
240 241 242 243 |
# File 'lib/whmcs/misc.rb', line 240 def self.add_banned_ip(params = {}) params.merge!(:action => 'addbannedip') send_request(params) end |
.add_product(params = {}) ⇒ Object
Add Product
Parameters:
- :type one of hostingaccount, reselleraccount, server or other
- :gid - the product group ID to add it to
- :name - the product name
- :paytype - free, onetime or recurring
Optional attributes:
- :description - the product description
- :hidden - set true to hide
- :showdomainoptions - set true to show
- :welcomeemail - the email template ID for a welcome email
- :qty - set quantity to enable stock control
- :proratadate
- :proratachargenextmonth
- :autosetup - on, payment, order or blank for none
- :module - module name
- :servergroupid - server group ID
- :subdomain - subdomain to offer with product
- :tax - set true to apply tax
- :order - display sort order to override default
- :configoption1
- :configoption2
- :pricing
See:
208 209 210 211 |
# File 'lib/whmcs/misc.rb', line 208 def self.add_product(params = {}) params.merge!(:action => 'addproduct') send_request(params) end |
.decrypt_password(params = {}) ⇒ Object
174 175 176 177 |
# File 'lib/whmcs/misc.rb', line 174 def self.decrypt_password(params = {}) params.merge!(:action => 'decryptpassword') send_request(params) end |
.encrypt_password(params = {}) ⇒ Object
157 158 159 160 |
# File 'lib/whmcs/misc.rb', line 157 def self.encrypt_password(params = {}) params.merge!(:action => 'encryptpassword') send_request(params) end |
.get_activity_log(params = {}) ⇒ Object
15 16 17 18 |
# File 'lib/whmcs/misc.rb', line 15 def self.get_activity_log(params = {}) params.merge!(:action => 'getactivitylog') send_request(params) end |
.get_admin_details ⇒ Object
25 26 27 |
# File 'lib/whmcs/misc.rb', line 25 def self.get_admin_details send_request(:action => 'getadmindetails') end |
.get_currencies ⇒ Object
69 70 71 72 |
# File 'lib/whmcs/misc.rb', line 69 def self.get_currencies params.merge!(:action => 'getcurrencies') send_request(params) end |
.get_email_templates(params = {}) ⇒ Object
101 102 103 104 |
# File 'lib/whmcs/misc.rb', line 101 def self.get_email_templates(params = {}) params.merge!(:action => 'getemailtemplates') send_request(params) end |
.get_promotions(params = {}) ⇒ Object
86 87 88 89 |
# File 'lib/whmcs/misc.rb', line 86 def self.get_promotions(params = {}) params.merge!(:action => 'getpromotions') send_request(params) end |
.get_staff_online ⇒ Object
135 136 137 |
# File 'lib/whmcs/misc.rb', line 135 def self.get_staff_online send_request(:action => 'getstaffonline') end |
.get_stats ⇒ Object
144 145 146 |
# File 'lib/whmcs/misc.rb', line 144 def self.get_stats send_request(:action => 'getstats') end |
.get_todo_item_statuses ⇒ Object
126 127 128 |
# File 'lib/whmcs/misc.rb', line 126 def self.get_todo_item_statuses send_request(:action => 'gettodoitemstatuses') end |
.get_todo_items(params = {}) ⇒ Object
116 117 118 119 |
# File 'lib/whmcs/misc.rb', line 116 def self.get_todo_items(params = {}) params.merge!(:action => 'gettodoitems') send_request(params) end |
.log_activity(params = {}) ⇒ Object
Log Activity
Parameters:
- :description - Text to add to the log Optional attributes:
- :userid - UserID to assign the log to in order to appear in Client Log
See:
223 224 225 226 |
# File 'lib/whmcs/misc.rb', line 223 def self.log_activity(params = {}) params.merge!(:action => 'logactivity') send_request(params) end |
.send_admin_email(params = {}) ⇒ Object
Send Admin Email This command is used to send an email to Admin users
Parameters:
- :messagename - Name of the Admin email template to send
- :mergefields - array of merge fields to populate the template being sent
- :type - Who to send the email to. One of system, account or support. Default: system
Optional attributes:
- :customsubject - Subject for a custommessage being sent
- :custommessage - Send a custom email to admin users, this will override 'messagename'
- :deptid - If type = support, the users of a department to send email to
See:
261 262 263 264 |
# File 'lib/whmcs/misc.rb', line 261 def self.send_admin_email(params = {}) params.merge!(:action => 'sendadminemail') send_request(params) end |
.update_admin_notes(params = {}) ⇒ Object
38 39 40 41 |
# File 'lib/whmcs/misc.rb', line 38 def self.update_admin_notes(params = {}) params.merge!(:action => 'updateadminnotes') send_request(params) end |
.update_todo_item(params = {}) ⇒ Object
Up To-Do Item
Parameter:
- :itemid - ID of the ToDo in WHMCS to update
- :adminid - Admin ID to update the To Do item to
Optional attributes:
- :date - open date of the To Do YYYYMMDD
- :title - Title of the to do
- :description - Text of the To Do
- :status - Status - New, Pending, In Progress, Completed, Postponed
- :duedate - due date of the To Do YYYYMMDD
See:
59 60 61 62 |
# File 'lib/whmcs/misc.rb', line 59 def self.update_todo_item(params = {}) params.merge!(:action => 'updatetodoitem') send_request(params) end |