Eskiz Plugin
Eskiz Plugin is a Java-based tool designed to integrate with the Eskiz SMS API. This plugin enables developers to send SMS, manage templates, track SMS statuses, and generate reports with ease. It serves as an efficient bridge for automating SMS communications in any Java application.
Features
- Send SMS: Seamlessly send SMS messages to users.
- Template Management: Create and manage SMS templates for consistent messaging.
- Report Generation: Fetch detailed reports for sent SMS by date or month.
- Status Tracking: Monitor the delivery status of sent SMS messages.
- User Data Management: Retrieve user-related data for better insights.
Project Structure
Prerequisites
Ensure the following tools and environments are available:
- Java (version 11 or higher)
- Maven (for dependency management)
- Access to Eskiz API credentials:
Email
Password
Sender Name
Callback URL
Installation
-
Clone the repository:
git clone https://github.com/yourusername/eskiz-plugin.git
cd eskiz-plugin
-
Configure the application:
Update the application.yml file with your Eskiz API credentials:
eskiz:
simulate: false # Set to true for testing without actually sending SMS
email: 'your-email' # Your registered email on Eskiz
password: 'your-password' # Your Eskiz account password
sender-name: 'your-sender-name' # The sender name or ID used in SMS
callback-url: 'your-callback-url' # Optional callback URL for delivery reports
-
Build the project using Maven:
mvn clean install
-
Include the plugin in your Java application by importing the appropriate classes.
Usage
Sending SMS
Use SendSmsService to send SMS messages. Example:
@Autowired
private SendSmsService sendSmsService;
public void sendMessage() {
SendSmsResponseDTO response = sendSmsService.sendSms("998901234567", "Hello, this is a test message.");
System.out.println("Message sent: " + response.getMessage());
}
Fetching Reports
Use ReportService to fetch SMS reports. Example:
@Autowired
private ReportService reportService;
public void getMonthlyReport() {
ReportByMonthResponseDTO report = reportService.getReportByMonth("2024-11");
System.out.println("Total Messages Sent: " + report.getTotalMessages());
}
Managing Templates
Use TemplateService to manage SMS templates. Example:
@Autowired
private TemplateService templateService;
public void createTemplate() {
TemplateResponseDTO template = templateService.createTemplate("Greetings", "Hello, welcome to our service!");
System.out.println("Template ID: " + template.getId());
}
Contribution
We welcome contributions! Please follow these steps:
- Fork the repository.
- Create a new branch (
feature/my-feature).
- Commit your changes.
- Push to the branch.
- Open a Pull Request.
License
This project is licensed under the MIT License. See the LICENSE file for details.
For any issues or inquiries, please contact:
评论