Skip to content

Commit

Permalink
version 4.3.6
Browse files Browse the repository at this point in the history
  • Loading branch information
jasp402 committed May 17, 2024
1 parent 8b291fd commit 0885716
Show file tree
Hide file tree
Showing 9 changed files with 384 additions and 67 deletions.
22 changes: 20 additions & 2 deletions Writerside/topics/Improvements.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
# Improvements
# 🙌 Contributing
### Suggesting Improvements

Start typing here...
We believe in the power of community collaboration to make Easy-YOPMail even better! We welcome your ideas and suggestions for improvements. Here's how you can contribute:

**1. Open an Issue:**

- Head over to our [GitHub repository](https://github.com/jasp402/Easy-YOPmail)
- Click on the "Issues" tab.
- Click the "New Issue" button.
- Clearly describe the improvement you'd like to suggest. Provide as much detail as possible, including examples or use cases.

**2. Discuss Your Idea:**

- We encourage you to engage in discussions within the issue. Share your thoughts, ask questions, and collaborate with other community members and the maintainers.

**3. Submit a Pull Request (Optional):**

- If you're comfortable with coding, consider submitting a pull request with your proposed changes. Make sure to follow the guidelines outlined in our [CONTRIBUTING.md](link-to-your-contributing-file) file.

We appreciate your contributions and strive to make Easy-YOPMail a valuable tool for everyone!
19 changes: 17 additions & 2 deletions Writerside/topics/Sponsors.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# Sponsors
# 💖 Supporting Easy-YOPMail: Become a Sponsor

Start typing here...
We deeply appreciate your interest in supporting Easy-YOPMail! Your sponsorship helps us maintain and enhance the library, bringing valuable features and improvements to the community.

Here are a few ways you can contribute:

**1. Financial Support:**

- **Patreon:** Join our community on Patreon and get exclusive benefits! [https://www.patreon.com/patreon.com/jasp402](https://www.patreon.com/patreon.com/jasp402)
- **Buy Me a Coffee:** Fuel our coding sessions with a quick coffee! [https://buymeacoffee.com/wjton2s](https://buymeacoffee.com/wjton2s)
- **Ko-fi:** Show your support with a one-time donation. [https://ko-fi.com/jasp402](https://ko-fi.com/jasp402)

**2. Show Your Love on GitHub:**

- **Star the Repository:** Give us a star on GitHub to show your appreciation and help increase visibility. [Link to your GitHub repository](link-to-your-GitHub-repository)
- **GitHub Sponsors:** Become a sponsor through GitHub Sponsors and directly contribute to the project's development. [Link to your GitHub Sponsors profile](link-to-your-GitHub-Sponsors-profile)

Every contribution, big or small, helps us immensely. We are incredibly grateful for your support!
51 changes: 49 additions & 2 deletions Writerside/topics/deleteInbox.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,50 @@
# deleteInbox()
# 🗑️ deleteInbox()

Start typing here...
The `deleteInbox()` function in the Easy-YOPMail library provides a simple and efficient way to completely erase all emails within a specified YOPmail inbox. This function is especially useful when you need to clean up a temporary email address after its intended use, ensuring privacy and avoiding clutter.

## Purpose

The main purpose of `deleteInbox()` is to provide a programmatic way to clear out all messages from a YOPmail inbox. This is beneficial for several reasons:

- **Privacy:** By deleting the inbox, you ensure that any sensitive information potentially contained within the emails is permanently removed.
- **Cleanliness:** It helps maintain a clutter-free YOPmail account, especially if you use temporary email addresses frequently.
- **Automation:** `deleteInbox()` enables the automation of cleanup tasks, allowing you to seamlessly integrate inbox deletion into your workflows.

## Functionality

Internally, the `deleteInbox()` function performs the following steps:

1. **Inbox Check:** It first checks if the specified YOPmail inbox contains any emails. If the inbox is already empty, it returns a notification indicating that no action was taken.
2. **Prepare Deletion Request:** If emails are present, it constructs a specialized HTTP GET request designed to delete the entire inbox. This request includes essential parameters like the email address, security tokens, and a specific flag signaling a complete inbox deletion.
3. **Execute Deletion:** The crafted request is then sent to the YOPmail server. If successful, the server will process the request and permanently erase all emails within the targeted inbox.
4. **Return Confirmation:** Upon completion, the function returns a success message confirming the deletion of the inbox and the number of emails removed. In case of an error during the deletion process, it returns an error message indicating the failure.

## Implementation

Using `deleteInbox()` in your project is straightforward. Here's a simple example:

```javascript
const easyYopmail = require('easy-yopmail');

async function cleanupYopmailInbox() {
try {
const result = await easyYopmail.deleteInbox('your-yopmail-address');
console.log(result);
// Output: Success or error message based on the deletion result

} catch (error) {
console.error("Error:", error);
}
}

cleanupYopmailInbox();
```

## Important Notes

- **Permanence:** Deleting an inbox is irreversible. Once executed, the emails are permanently removed from the YOPmail server.
- **Error Handling:** It's important to handle potential errors during the deletion process. The function will throw an error if it encounters issues, allowing you to implement appropriate error handling mechanisms in your code.

## Conclusion

The `deleteInbox()` function simplifies the process of managing temporary email addresses by providing a quick and reliable way to erase their contents. This functionality is valuable for maintaining privacy, cleanliness, and automation in projects involving YOPmail. By integrating `deleteInbox()` into your workflows, you can ensure a secure and organized use of temporary email addresses.
55 changes: 53 additions & 2 deletions Writerside/topics/deleteMessage.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,54 @@
# deleteMessage()
# 🗑️ deleteMessage()

Start typing here...
The `deleteMessage()` function within the Easy-YOPMail library empowers developers to selectively remove individual emails from a YOPmail inbox. This function is valuable when you need to remove specific messages while retaining others, offering a more granular level of control over inbox management.

## Purpose

The primary purpose of `deleteMessage()` is to provide a method for deleting specific emails from a YOPmail inbox based on their unique identifier. This is particularly useful for:

- **Targeted Cleanup:** Removing individual emails that are no longer needed or relevant, such as expired verification codes or unwanted notifications.
- **Data Management:** Selectively deleting messages to maintain a clean and organized inbox, focusing on retaining important emails while discarding others.
- **Privacy Enhancement:** Removing sensitive or confidential emails from the inbox to minimize potential privacy risks.

## Functionality

The `deleteMessage()` function operates through the following steps:

1. **Message Verification:** It begins by verifying whether the specified email exists within the target YOPmail inbox. This check prevents unnecessary processing if the message is not found.
2. **Deletion Request Preparation:** If the email is present, the function constructs a specific HTTP GET request designed to delete that individual message. This request includes crucial parameters like the email address, the unique identifier of the target message, security tokens, and a specific flag signaling the deletion of a single message.
3. **Execute Deletion:** The formulated request is then transmitted to the YOPmail server. Upon successful processing, the server permanently removes the targeted email from the inbox.
4. **Confirmation Return:** After the deletion attempt, the function returns a notification message:
- If the email was successfully deleted, it provides a success message confirming the removal.
- If the email was not found, it returns a message stating that the email was not located and no deletion occurred.
- In case of errors during the process, it returns an error message indicating the failure to delete the message.

## Implementation

Integrating `deleteMessage()` into your project is simple. Here's an example demonstrating its usage:

```javascript
const easyYopmail = require('easy-yopmail');

async function removeSpecificEmail() {
try {
const messageId = 'your-email-id'; // Replace with the actual email ID
const result = await easyYopmail.deleteMessage('your-yopmail-address', messageId);
console.log(result);
// Output: Success, email not found, or error message based on the result

} catch (error) {
console.error("Error:", error);
}
}

removeSpecificEmail();
```

## Important Notes

- **Message ID:** Ensure you provide the correct unique identifier of the email you intend to delete. You can obtain this ID using the `getInbox()` function, which lists all emails and their corresponding identifiers.
- **Error Handling:** Implement appropriate error handling mechanisms to address potential issues during the deletion process. The function will throw an error if it encounters problems, allowing you to handle such situations gracefully in your code.

## Conclusion

The `deleteMessage()` function enhances the flexibility of YOPmail inbox management by enabling the selective removal of individual emails. This functionality is highly beneficial for maintaining a clean, organized, and privacy-conscious usage of temporary email addresses in your projects. By incorporating `deleteMessage()` into your workflows, you gain more granular control over your YOPmail interactions.
60 changes: 58 additions & 2 deletions Writerside/topics/getInbox.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,59 @@
# getInbox()
# 📬 getInbox()

Start typing here...
The `getInbox()` function in the Easy-YOPMail library provides a streamlined way to access and retrieve the contents of a YOPmail inbox. This function is essential for managing temporary email addresses and interacting with received messages programmatically.

## Purpose

The `getInbox()` function serves the following purposes:

* **Inbox Retrieval:** It fetches the inbox contents of a specified YOPmail address, providing a list of emails received at that address.
* **Email Management:** By accessing the inbox, developers can programmatically manage emails, enabling actions like reading, deleting, or filtering messages based on various criteria.
* **Automation:** `getInbox()` facilitates the automation of tasks involving temporary email addresses, such as collecting verification codes, monitoring for specific emails, or scraping data from received messages.

## Functionality

The `getInbox()` function performs the following actions:

1. **Request Inbox Data:** It sends an HTTP GET request to the YOPmail server, targeting the inbox of the provided email address. This request includes essential parameters like the email address and pagination details.
2. **Parse Inbox HTML:** Upon receiving the server response, the function parses the HTML content of the inbox page. It extracts key information about each email, including the sender, subject, timestamp, and a unique identifier.
3. **Structure Inbox Data:** The extracted information is then organized into a structured JavaScript object. This object provides an overview of the inbox, including the total number of emails, pagination details, and an array of email objects, each representing a single email in the inbox.
4. **Apply Filtering (Optional):** The `getInbox()` function can optionally accept a `search` object as a parameter. This object allows developers to filter the retrieved emails based on criteria like sender, subject, or timestamp.
5. **Return Inbox Object:** Finally, the function returns the structured inbox object, containing all retrieved email information and relevant metadata.

## Implementation

Here's an example demonstrating how to use `getInbox()` in your Node.js project:

```javascript
const easyYopmail = require('easy-yopmail');

async function checkInbox() {
try {
const inbox = await easyYopmail.getInbox('your-yopmail-address');
console.log(inbox);
// Output: A detailed inbox object containing email information

} catch (error) {
console.error("Error:", error);
}
}

checkInbox();
```

## Optional Search Parameter

The `search` parameter allows filtering emails based on specific criteria. Here's an example demonstrating its usage:

```javascript
const searchCriteria = {
from: '[email protected]',
};

const inbox = await easyYopmail.getInbox('your-yopmail-address', searchCriteria);
// This will only return emails from '[email protected]'
```

## Conclusion

The `getInbox()` function offers a versatile and efficient method to interact with YOPmail inboxes, empowering developers to automate tasks, manage temporary email addresses, and access received emails programmatically. By understanding its functionality and implementation, you can effectively leverage this tool in your Node.js projects.
63 changes: 61 additions & 2 deletions Writerside/topics/getMail.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,62 @@
# getMail()
# 📧 getMail()

Start typing here...
The `getMail()` function is a powerful tool offered by the Easy-YOPMail library that allows developers to dynamically generate random email addresses. This feature is especially useful in scenarios where a unique and temporary email address is required without the need for manual interaction with a web interface or complex configurations.

## Purpose

The primary purpose of `getMail()` is to simplify the process of acquiring a temporary email address for various use cases, including:

* **Automated Testing:** In scenarios involving automated testing of applications or services, using `getMail()` can streamline the process of creating unique email addresses for each test run, ensuring data integrity and preventing conflicts.
* **Web Scraping:** When extracting data from websites that require email registration, `getMail()` enables the automation of this process by providing a continuous supply of temporary email addresses without manual intervention.
* **Anonymous Sign-Ups:** For situations where users need to sign up for services without revealing their primary email address, `getMail()` offers a convenient solution by generating disposable addresses that can be discarded after use.

## How it Works

Internally, the `getMail()` function performs the following steps:

1. **Initiates a Request:** It starts by sending an HTTP GET request to the YOPmail website to obtain an initial page. This page contains essential information, such as the version of the YOPmail platform, which is crucial for subsequent interactions.
2. **Extracts Relevant Data:** Upon receiving the response, `getMail()` carefully analyzes the HTML content to extract crucial elements, particularly focusing on the section responsible for generating temporary email addresses. It utilizes techniques like regular expressions and HTML parsing libraries to pinpoint this data accurately.
3. **Constructs the Email Address:** Once the necessary information is extracted, `getMail()` proceeds to construct a valid and random email address in the format `[randomly generated name]@yopmail.com`. This ensures uniqueness and avoids conflicts with existing addresses.
4. **Returns the Email Address:** Finally, the function returns the newly generated temporary email address to the caller, ready for use in the intended application.

## Implementation

Here's a breakdown of how to implement `getMail()` in your Node.js project:

1. **Import the Easy-YOPMail Library:**
```javascript
const easyYopmail = require('easy-yopmail');
```

2. **Invoke the `getMail()` function:**
```javascript
easyYopmail.getMail().then(email => {
console.log(email);
// Output: [randomly generated name]@yopmail.com
});
```

## Example Usage

The following code snippet demonstrates how to generate a temporary email address using `getMail()` and subsequently utilize it for tasks like registration or testing:

```javascript
const easyYopmail = require('easy-yopmail');
async function registerWithTemporaryEmail() {
try {
const temporaryEmail = await easyYopmail.getMail();
console.log("Temporary Email:", temporaryEmail);
// Use the temporaryEmail for registration or testing purposes
// ...
} catch (error) {
console.error("Error:", error);
}
}
registerWithTemporaryEmail();
```

This example highlights the ease of integration and the potential of `getMail()` in streamlining workflows that involve temporary email addresses.
Loading

0 comments on commit 0885716

Please sign in to comment.