javascript Mautic批量删除线索

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了javascript Mautic批量删除线索相关的知识,希望对你有一定的参考价值。


// These constants were defined according to the performance of my server.
// You can tweak them, particularily in case actions are triggered before the previous one has ended.
const waitForTableData = 3000 // how long to wait for the table data to be refreshed.
const waitForCheckboxes = 3000 // how long to wait for the checkboxes to be clicked.
const waitForModal = 3000 // how long to wait for the modal to appear
const interval = 30000 // The interval between two scripts run.

// Define a callback to delete leads
const deleteLeads = () => { 
	// Hack Mautic limit of 100 rows per page. When I set 500 rows it's buggy...
  	Mautic.limitTableData('lead',300,'list','.page-list', '/s/contacts'); 
	setTimeout(() => {
		// Click the headers checkbox to trigger checking all rows.
		jQuery('#customcheckbox-one0').click()

		setTimeout(() => {
			// Click the batchDelete button.
			jQuery('a[href="/s/contacts/batchDelete"]').click()
			setTimeout(() => {
				// Click the modal's delete button.
				jQuery('.modal[aria-hidden="false"] .btn-danger').click()
			}, waitForModal)
		}, waitForCheckboxes)
	}, waitForTableData)
}

// First trigger
deleteLeads()

// And run
setInterval(() => {
	deleteLeads()
}, interval)

以上是关于javascript Mautic批量删除线索的主要内容,如果未能解决你的问题,请参考以下文章

javascript mautic JS

完成受监控的收件箱设置后,Mautic 邮件发送设置无法工作

javascript Firebase托管批量删除历史记录

text mautic nginx

php mautic webhook

php mautic短信