Class: WHMCS::Announcement

Inherits:
Base
  • Object
show all
Defined in:
lib/whmcs/announcement.rb

Class Method Summary collapse

Methods inherited from Base

parse_response, send_request

Class Method Details

.add_announcement(params = {}) ⇒ Object

Add Announcement This command is used to Add a new announcement to the system

Parameters:

  • :date - Date of the announcement in format yyyymmdd

  • :title - Title of the announcement

  • :announcement - Announcement text

  • :published - on/off

Returns:

* <tt>:result</tt>
* <tt>:announcementid</tt>

See:

docs.whmcs.com/API:Add_Announcement



18
19
20
21
# File 'lib/whmcs/announcement.rb', line 18

def self.add_announcement(params = {})
  params.merge!(:action => 'addannouncement')
  send_request(params)
end

.delete_announcement(params = {}) ⇒ Object

Delete Announcement

Parameters:

  • :announcementid - The ID of the announcement to delete

See:

docs.whmcs.com/API:Delete_Announcement



63
64
65
66
# File 'lib/whmcs/announcement.rb', line 63

def self.delete_announcement(params = {})
  params.merge!(:action => 'deleteannouncement')
  send_request(params)
end

.get_announcements(params = {}) ⇒ Object

Get Announcements This command is used to get a list of the announcements in XML format

Parameters:

  • :limitstart - used for pagination, start at a certain ID

  • :limitnum - restrict number of records

See:

docs.whmcs.com/API:Get_Announcements



50
51
52
53
# File 'lib/whmcs/announcement.rb', line 50

def self.get_announcements(params ={})
  params.merge!(:action => 'getannouncements')
  send_request(params)
end

.update_announcement(params = {}) ⇒ Object

Update Announcement

Parameters:

  • :announcementid - ID of the announcement to edit

  • :date - Date of the announcement in format yyyymmdd

  • :title - Title of the announcement

  • :announcement - Announcement text

  • :published - on/off

See:

docs.whmcs.com/API:Update_Announcement



35
36
37
38
# File 'lib/whmcs/announcement.rb', line 35

def self.update_announcement(params = {})
  params.merge!(:action => 'updateannouncement')
  send_request(params)
end